From f25f5c5267313f4e1b64e6f735828a28337af20f Mon Sep 17 00:00:00 2001 From: Jack Ye Date: Tue, 21 Apr 2026 15:10:01 -0700 Subject: [PATCH] Update CreateTable REST params and remove CreateEmptyTable --- docs/src/client/operations/errors.md | 1 - docs/src/client/operations/index.md | 1 - .../models/CreateEmptyTableRequest.md | 19 - .../models/CreateEmptyTableResponse.md | 17 - .../operations/models/CreateTableRequest.md | 5 +- .../operations/models/CreateTableResponse.md | 2 +- .../operations/models/DeclareTableRequest.md | 2 +- docs/src/rest.yaml | 161 ++----- docs/src/rest/impl-spec.md | 33 +- java/lance-namespace-apache-client/README.md | 4 - .../api/openapi.yaml | 216 +++------ .../docs/CreateEmptyTableRequest.md | 19 - .../docs/CreateEmptyTableResponse.md | 17 - .../docs/CreateTableRequest.md | 5 +- .../docs/CreateTableResponse.md | 2 +- .../docs/DataApi.md | 11 +- .../docs/DeclareTableRequest.md | 2 +- .../docs/MetadataApi.md | 93 ---- .../docs/TableApi.md | 104 +---- .../namespace/client/apache/api/DataApi.java | 57 ++- .../client/apache/api/MetadataApi.java | 114 ----- .../namespace/client/apache/api/TableApi.java | 171 +++---- .../model/CreateEmptyTableRequest.java | 426 ------------------ .../model/CreateEmptyTableResponse.java | 326 -------------- .../namespace/model/CreateTableRequest.java | 77 +++- .../namespace/model/CreateTableResponse.java | 5 +- .../namespace/model/DeclareTableRequest.java | 3 +- java/lance-namespace-async-client/README.md | 6 - .../api/openapi.yaml | 216 +++------ .../docs/CreateEmptyTableRequest.md | 19 - .../docs/CreateEmptyTableResponse.md | 17 - .../docs/CreateTableRequest.md | 5 +- .../docs/CreateTableResponse.md | 2 +- .../docs/DataApi.md | 22 +- .../docs/DeclareTableRequest.md | 2 +- .../docs/MetadataApi.md | 197 -------- .../docs/TableApi.md | 219 +-------- .../namespace/client/async/api/DataApi.java | 68 ++- .../client/async/api/MetadataApi.java | 165 ------- .../namespace/client/async/api/TableApi.java | 233 +++------- .../model/CreateEmptyTableRequest.java | 387 ---------------- .../model/CreateEmptyTableResponse.java | 295 ------------ .../namespace/model/CreateTableRequest.java | 70 ++- .../namespace/model/CreateTableResponse.java | 5 +- .../namespace/model/DeclareTableRequest.java | 3 +- .../namespace/async/LanceNamespaceAsync.java | 14 - .../org/lance/namespace/LanceNamespace.java | 12 - .../server/springboot/api/TableApi.java | 255 +++-------- .../model/CreateEmptyTableRequest.java | 267 ----------- .../model/CreateEmptyTableResponse.java | 202 --------- .../springboot/model/CreateTableRequest.java | 56 ++- .../springboot/model/CreateTableResponse.java | 7 +- .../springboot/model/DeclareTableRequest.java | 6 +- .../lance_namespace/__init__.py | 29 -- .../lance_namespace_urllib3_client/README.md | 4 - .../docs/CreateEmptyTableRequest.md | 35 -- .../docs/CreateEmptyTableResponse.md | 33 -- .../docs/CreateTableRequest.md | 5 +- .../docs/CreateTableResponse.md | 2 +- .../docs/DataApi.md | 15 +- .../docs/DeclareTableRequest.md | 2 +- .../docs/MetadataApi.md | 108 ----- .../docs/TableApi.md | 123 +---- .../__init__.py | 2 - .../api/data_api.py | 43 +- .../api/metadata_api.py | 334 -------------- .../api/table_api.py | 377 ++-------------- .../models/__init__.py | 2 - .../models/create_empty_table_request.py | 101 ----- .../models/create_empty_table_response.py | 93 ---- .../models/create_table_request.py | 10 +- .../models/create_table_response.py | 2 +- .../models/declare_table_request.py | 2 +- .../test/test_create_empty_table_request.py | 64 --- .../test/test_create_empty_table_response.py | 56 --- .../test/test_create_table_request.py | 3 + .../test/test_metadata_api.py | 7 - .../test/test_table_api.py | 7 - rust/lance-namespace-reqwest-client/README.md | 4 - .../docs/CreateEmptyTableRequest.md | 16 - .../docs/CreateEmptyTableResponse.md | 14 - .../docs/CreateTableRequest.md | 3 +- .../docs/CreateTableResponse.md | 2 +- .../docs/DataApi.md | 6 +- .../docs/DeclareTableRequest.md | 2 +- .../docs/MetadataApi.md | 33 -- .../docs/TableApi.md | 39 +- .../src/apis/data_api.rs | 13 +- .../src/apis/metadata_api.rs | 71 --- .../src/apis/table_api.rs | 84 +--- .../src/models/create_empty_table_request.rs | 48 -- .../src/models/create_empty_table_response.rs | 41 -- .../src/models/create_table_request.rs | 10 +- .../src/models/create_table_response.rs | 2 +- .../src/models/declare_table_request.rs | 2 +- .../src/models/mod.rs | 4 - 96 files changed, 915 insertions(+), 5581 deletions(-) delete mode 100644 docs/src/client/operations/models/CreateEmptyTableRequest.md delete mode 100644 docs/src/client/operations/models/CreateEmptyTableResponse.md delete mode 100644 java/lance-namespace-apache-client/docs/CreateEmptyTableRequest.md delete mode 100644 java/lance-namespace-apache-client/docs/CreateEmptyTableResponse.md delete mode 100644 java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java delete mode 100644 java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java delete mode 100644 java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md delete mode 100644 java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md delete mode 100644 java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java delete mode 100644 java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java delete mode 100644 java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableRequest.java delete mode 100644 java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableResponse.java delete mode 100644 python/lance_namespace_urllib3_client/docs/CreateEmptyTableRequest.md delete mode 100644 python/lance_namespace_urllib3_client/docs/CreateEmptyTableResponse.md delete mode 100644 python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_request.py delete mode 100644 python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_response.py delete mode 100644 python/lance_namespace_urllib3_client/test/test_create_empty_table_request.py delete mode 100644 python/lance_namespace_urllib3_client/test/test_create_empty_table_response.py delete mode 100644 rust/lance-namespace-reqwest-client/docs/CreateEmptyTableRequest.md delete mode 100644 rust/lance-namespace-reqwest-client/docs/CreateEmptyTableResponse.md delete mode 100644 rust/lance-namespace-reqwest-client/src/models/create_empty_table_request.rs delete mode 100644 rust/lance-namespace-reqwest-client/src/models/create_empty_table_response.rs diff --git a/docs/src/client/operations/errors.md b/docs/src/client/operations/errors.md index 19388be4a..19e5c21e0 100644 --- a/docs/src/client/operations/errors.md +++ b/docs/src/client/operations/errors.md @@ -71,7 +71,6 @@ All operations may return the following errors: | TableExists | 1 (NamespaceNotFound), 4 (TableNotFound) | | DropTable | 1 (NamespaceNotFound), 4 (TableNotFound) | | DeregisterTable | 1 (NamespaceNotFound), 4 (TableNotFound) | -| CreateEmptyTable | 1 (NamespaceNotFound), 5 (TableAlreadyExists), 14 (ConcurrentModification) | | RestoreTable | 1 (NamespaceNotFound), 4 (TableNotFound), 11 (TableVersionNotFound), 14 (ConcurrentModification) | | RenameTable | 1 (NamespaceNotFound), 4 (TableNotFound), 5 (TableAlreadyExists), 14 (ConcurrentModification) | | GetTableStats | 1 (NamespaceNotFound), 4 (TableNotFound) | diff --git a/docs/src/client/operations/index.md b/docs/src/client/operations/index.md index 1ca0e99f3..354fbe332 100644 --- a/docs/src/client/operations/index.md +++ b/docs/src/client/operations/index.md @@ -61,7 +61,6 @@ See [REST Routes](../../rest/catalog-spec.md#rest-routes) for more details. | CountTableRows | 1 | | ✓ | | | ✓ | | | CreateTable | 1 | | ✓ | | | ✓ | | | DeclareTable | 1 | | ✓ | | ✓ | | | -| CreateEmptyTable | 1 (deprecated) | | ✓ | | ✓ | | | | CreateTableIndex | 1 | | ✓ | ✓ | ✓ | | | | CreateTableScalarIndex | 1 | | ✓ | ✓ | ✓ | | | | ListTableIndices | 1 | | ✓ | ✓ | ✓ | | | diff --git a/docs/src/client/operations/models/CreateEmptyTableRequest.md b/docs/src/client/operations/models/CreateEmptyTableRequest.md deleted file mode 100644 index ed3845f46..000000000 --- a/docs/src/client/operations/models/CreateEmptyTableRequest.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CreateEmptyTableRequest - -Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**identity** | [**Identity**](Identity.md) | | [optional] | -|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | -|**id** | **List<String>** | | [optional] | -|**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | -|**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | - - - diff --git a/docs/src/client/operations/models/CreateEmptyTableResponse.md b/docs/src/client/operations/models/CreateEmptyTableResponse.md deleted file mode 100644 index 39ce092a1..000000000 --- a/docs/src/client/operations/models/CreateEmptyTableResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CreateEmptyTableResponse - -Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactionId** | **String** | Optional transaction identifier | [optional] | -|**location** | **String** | | [optional] | -|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | -|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | - - - diff --git a/docs/src/client/operations/models/CreateTableRequest.md b/docs/src/client/operations/models/CreateTableRequest.md index 38a18ebaf..c5ecc1ae0 100644 --- a/docs/src/client/operations/models/CreateTableRequest.md +++ b/docs/src/client/operations/models/CreateTableRequest.md @@ -2,7 +2,7 @@ # CreateTableRequest -Request for creating a table, excluding the Arrow IPC stream. +Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. ## Properties @@ -12,7 +12,8 @@ Request for creating a table, excluding the Arrow IPC stream. |**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | |**id** | **List<String>** | | [optional] | |**mode** | **String** | There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the implementation. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] | +|**storageOptions** | **Map<String, String>** | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. | [optional] | diff --git a/docs/src/client/operations/models/CreateTableResponse.md b/docs/src/client/operations/models/CreateTableResponse.md index 3997eb4d1..cfab4f158 100644 --- a/docs/src/client/operations/models/CreateTableResponse.md +++ b/docs/src/client/operations/models/CreateTableResponse.md @@ -11,7 +11,7 @@ |**location** | **String** | | [optional] | |**version** | **Long** | | [optional] | |**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | -|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. | [optional] | diff --git a/docs/src/client/operations/models/DeclareTableRequest.md b/docs/src/client/operations/models/DeclareTableRequest.md index 7a58a8315..1bc7858b3 100644 --- a/docs/src/client/operations/models/DeclareTableRequest.md +++ b/docs/src/client/operations/models/DeclareTableRequest.md @@ -13,7 +13,7 @@ Request for declaring a table. |**id** | **List<String>** | | [optional] | |**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | |**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] | diff --git a/docs/src/rest.yaml b/docs/src/rest.yaml index 944ad7209..f31ae1377 100644 --- a/docs/src/rest.yaml +++ b/docs/src/rest.yaml @@ -1321,6 +1321,25 @@ paths: required: false schema: type: string + - name: "properties" + in: query + required: false + schema: + type: string + description: | + Business logic properties managed by the namespace implementation outside Lance context. + The map is translated to a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`. + - name: "storage_options" + in: query + required: false + schema: + type: string + description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. + The map is translated to a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`. post: tags: - Table @@ -1338,6 +1357,12 @@ paths: It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + - `properties`: serialize as a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`; these are business logic properties + managed by the namespace implementation outside Lance context + - `storage_options`: serialize as a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure + write-time overrides for data and metadata written during table creation requestBody: description: Arrow IPC data content: @@ -1357,6 +1382,8 @@ paths: $ref: "#/components/responses/ForbiddenErrorResponse" 404: $ref: "#/components/responses/NotFoundErrorResponse" + 409: + $ref: "#/components/responses/ConflictErrorResponse" 503: $ref: "#/components/responses/ServiceUnavailableErrorResponse" 5XX: @@ -1792,49 +1819,6 @@ paths: 5XX: $ref: "#/components/responses/ServerErrorResponse" - /v1/table/{id}/create-empty: - parameters: - - $ref: "#/components/parameters/id" - - $ref: "#/components/parameters/delimiter" - post: - tags: - - Table - - Metadata - summary: Create an empty table - operationId: CreateEmptyTable - deprecated: true - description: | - Create an empty table with the given name without touching storage. - This is a metadata-only operation that records the table existence and sets up aspects like access control. - - For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory - to mark the table's existence without creating actual Lance data files. - - **Deprecated**: Use `DeclareTable` instead. - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/CreateEmptyTableRequest" - responses: - 200: - $ref: "#/components/responses/CreateEmptyTableResponse" - 400: - $ref: "#/components/responses/BadRequestErrorResponse" - 401: - $ref: "#/components/responses/UnauthorizedErrorResponse" - 403: - $ref: "#/components/responses/ForbiddenErrorResponse" - 404: - $ref: "#/components/responses/NotFoundErrorResponse" - 409: - $ref: "#/components/responses/ConflictErrorResponse" - 503: - $ref: "#/components/responses/ServiceUnavailableErrorResponse" - 5XX: - $ref: "#/components/responses/ServerErrorResponse" - /v1/table/{id}/tags/create: parameters: - $ref: "#/components/parameters/id" @@ -3163,6 +3147,8 @@ components: type: object description: | Request for creating a table, excluding the Arrow IPC stream. + The table location and any credential vending behavior are determined by the implementation + and returned in the response, rather than specified in this request. properties: identity: $ref: "#/components/schemas/Identity" @@ -3184,87 +3170,30 @@ components: properties: type: object description: | - Properties stored on the table, if supported by the implementation. + Business logic properties stored and managed by the namespace implementation outside + Lance context, if supported by the implementation. additionalProperties: type: string - - CreateTableResponse: - type: object - properties: - transaction_id: - type: string - description: Optional transaction identifier - location: - type: string - version: - type: integer - format: int64 - minimum: 0 storage_options: type: object description: | - Configuration options to be used to access storage. The available - options depend on the type of storage in use. These will be - passed directly to Lance to initialize storage access. + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. additionalProperties: type: string - properties: - type: object - description: | - If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. - additionalProperties: - type: string - example: { "owner": "Ralph", "created_at": "1452120468" } - default: {} - nullable: true - - CreateEmptyTableRequest: - type: object - deprecated: true - description: | - Request for creating an empty table. - **Deprecated**: Use `DeclareTableRequest` instead. - properties: - identity: - $ref: "#/components/schemas/Identity" - context: - $ref: "#/components/schemas/Context" - id: - type: array - items: - type: string - location: - type: string - description: | - Optional storage location for the table. - If not provided, the namespace implementation should determine the table location. - vend_credentials: - description: | - Whether to include vended credentials in the response `storage_options`. - When true, the implementation should provide vended credentials for accessing storage. - When not set, the implementation can decide whether to return vended credentials. - type: boolean - properties: - type: object - description: | - Properties stored on the table, if supported by the server. - additionalProperties: - type: string - - CreateEmptyTableResponse: + CreateTableResponse: type: object - deprecated: true - description: | - Response for creating an empty table. - - **Deprecated**: Use `DeclareTableResponse` instead. properties: transaction_id: type: string description: Optional transaction identifier location: type: string + version: + type: integer + format: int64 + minimum: 0 storage_options: type: object description: | @@ -3276,7 +3205,9 @@ components: properties: type: object description: | - If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + Business logic properties stored and managed by the namespace implementation outside + Lance context. If the implementation does not support table properties, it should + return null for this field. additionalProperties: type: string example: { "owner": "Ralph", "created_at": "1452120468" } @@ -3310,7 +3241,8 @@ components: properties: type: object description: | - Properties stored on the table, if supported by the server. + Business logic properties stored and managed by the namespace implementation outside + Lance context, if supported by the implementation. additionalProperties: type: string @@ -5205,13 +5137,6 @@ components: schema: $ref: "#/components/schemas/DeclareTableResponse" - CreateEmptyTableResponse: - description: Table properties result when creating an empty table - content: - application/json: - schema: - $ref: "#/components/schemas/CreateEmptyTableResponse" - # Error Responses BadRequestErrorResponse: diff --git a/docs/src/rest/impl-spec.md b/docs/src/rest/impl-spec.md index 650853da7..79e1d0072 100644 --- a/docs/src/rest/impl-spec.md +++ b/docs/src/rest/impl-spec.md @@ -654,22 +654,37 @@ Content-Type: application/json Creates a new table with initial data. +For REST namespace, `CreateTableRequest` fields are passed as follows: + +- `id`: path parameter +- `mode`: query parameter +- `properties`: a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`; these are business logic properties managed + by the namespace implementation outside Lance context +- `storage_options`: a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure write-time + overrides for data and metadata written during table creation + **HTTP Request:** ``` POST /v1/table/{id}/create -Content-Type: application/json +Content-Type: application/vnd.apache.arrow.stream ``` -### CreateEmptyTable - -Creates an empty table with a specified schema. - -**HTTP Request:** +**Response:** -``` -POST /v1/table/{id}/create-empty -Content-Type: application/json +```json +{ + "location": "s3://bucket/data/users.lance", + "version": 1, + "storage_options": { + "aws_region": "us-east-1" + }, + "properties": { + "user": "alice" + } +} ``` ### GetTableStats diff --git a/java/lance-namespace-apache-client/README.md b/java/lance-namespace-apache-client/README.md index 7ee63441e..ffaa7e257 100644 --- a/java/lance-namespace-apache-client/README.md +++ b/java/lance-namespace-apache-client/README.md @@ -154,7 +154,6 @@ Class | Method | HTTP request | Description *MetadataApi* | [**batchCommitTables**](docs/MetadataApi.md#batchCommitTables) | **POST** /v1/table/batch-commit | Atomically commit a batch of mixed table operations *MetadataApi* | [**batchCreateTableVersions**](docs/MetadataApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *MetadataApi* | [**batchDeleteTableVersions**](docs/MetadataApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records -*MetadataApi* | [**createEmptyTable**](docs/MetadataApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table *MetadataApi* | [**createNamespace**](docs/MetadataApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace *MetadataApi* | [**createTableIndex**](docs/MetadataApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table *MetadataApi* | [**createTableScalarIndex**](docs/MetadataApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -199,7 +198,6 @@ Class | Method | HTTP request | Description *TableApi* | [**batchCreateTableVersions**](docs/TableApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *TableApi* | [**batchDeleteTableVersions**](docs/TableApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records *TableApi* | [**countTableRows**](docs/TableApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table -*TableApi* | [**createEmptyTable**](docs/TableApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table *TableApi* | [**createTable**](docs/TableApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name *TableApi* | [**createTableIndex**](docs/TableApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table *TableApi* | [**createTableScalarIndex**](docs/TableApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -272,8 +270,6 @@ Class | Method | HTTP request | Description - [CommitTableOperation](docs/CommitTableOperation.md) - [CommitTableResult](docs/CommitTableResult.md) - [CountTableRowsRequest](docs/CountTableRowsRequest.md) - - [CreateEmptyTableRequest](docs/CreateEmptyTableRequest.md) - - [CreateEmptyTableResponse](docs/CreateEmptyTableResponse.md) - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [CreateTableIndexRequest](docs/CreateTableIndexRequest.md) diff --git a/java/lance-namespace-apache-client/api/openapi.yaml b/java/lance-namespace-apache-client/api/openapi.yaml index 00cbcda75..0bbd07a4e 100644 --- a/java/lance-namespace-apache-client/api/openapi.yaml +++ b/java/lance-namespace-apache-client/api/openapi.yaml @@ -1565,6 +1565,29 @@ paths: schema: type: string style: form + - description: | + Business logic properties managed by the namespace implementation outside Lance context. + The map is translated to a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`. + explode: true + in: query + name: properties + required: false + schema: + type: string + style: form + - description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. + The map is translated to a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`. + explode: true + in: query + name: storage_options + required: false + schema: + type: string + style: form post: description: | Create table `id` in the namespace with the given data in Arrow IPC stream. @@ -1577,6 +1600,12 @@ paths: It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + - `properties`: serialize as a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`; these are business logic properties + managed by the namespace implementation outside Lance context + - `storage_options`: serialize as a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure + write-time overrides for data and metadata written during table creation operationId: CreateTable parameters: - $ref: '#/components/parameters/id' @@ -1588,6 +1617,29 @@ paths: schema: type: string style: form + - description: | + Business logic properties managed by the namespace implementation outside Lance context. + The map is translated to a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`. + explode: true + in: query + name: properties + required: false + schema: + type: string + style: form + - description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. + The map is translated to a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`. + explode: true + in: query + name: storage_options + required: false + schema: + type: string + style: form requestBody: content: application/vnd.apache.arrow.stream: @@ -1607,6 +1659,8 @@ paths: $ref: '#/components/responses/ForbiddenErrorResponse' "404": $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' "503": $ref: '#/components/responses/ServiceUnavailableErrorResponse' "5XX": @@ -2119,54 +2173,6 @@ paths: x-content-type: application/json x-accepts: - application/json - /v1/table/{id}/create-empty: - parameters: - - $ref: '#/components/parameters/id' - - $ref: '#/components/parameters/delimiter' - post: - deprecated: true - description: | - Create an empty table with the given name without touching storage. - This is a metadata-only operation that records the table existence and sets up aspects like access control. - - For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory - to mark the table's existence without creating actual Lance data files. - - **Deprecated**: Use `DeclareTable` instead. - operationId: CreateEmptyTable - parameters: - - $ref: '#/components/parameters/id' - - $ref: '#/components/parameters/delimiter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEmptyTableRequest' - required: true - responses: - "200": - $ref: '#/components/responses/CreateEmptyTableResponse' - "400": - $ref: '#/components/responses/BadRequestErrorResponse' - "401": - $ref: '#/components/responses/UnauthorizedErrorResponse' - "403": - $ref: '#/components/responses/ForbiddenErrorResponse' - "404": - $ref: '#/components/responses/NotFoundErrorResponse' - "409": - $ref: '#/components/responses/ConflictErrorResponse' - "503": - $ref: '#/components/responses/ServiceUnavailableErrorResponse' - "5XX": - $ref: '#/components/responses/ServerErrorResponse' - summary: Create an empty table - tags: - - Table - - Metadata - x-content-type: application/json - x-accepts: - - application/json /v1/table/{id}/tags/create: parameters: - $ref: '#/components/parameters/id' @@ -2715,12 +2721,6 @@ components: schema: $ref: '#/components/schemas/DeclareTableResponse' description: Table properties result when declaring a table - CreateEmptyTableResponse: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEmptyTableResponse' - description: Table properties result when creating an empty table BadRequestErrorResponse: content: application/json: @@ -4462,6 +4462,8 @@ components: CreateTableRequest: description: | Request for creating a table, excluding the Arrow IPC stream. + The table location and any credential vending behavior are determined by the implementation + and returned in the response, rather than specified in this request. properties: identity: $ref: '#/components/schemas/Identity' @@ -4493,7 +4495,14 @@ components: additionalProperties: type: string description: | - Properties stored on the table, if supported by the implementation. + Business logic properties stored and managed by the namespace implementation outside + Lance context, if supported by the implementation. + storage_options: + additionalProperties: + type: string + description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. CreateTableResponse: example: transaction_id: transaction_id @@ -4526,97 +4535,9 @@ components: type: string default: {} description: | - If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. - example: - owner: Ralph - created_at: "1452120468" - nullable: true - CreateEmptyTableRequest: - deprecated: true - description: | - Request for creating an empty table. - - **Deprecated**: Use `DeclareTableRequest` instead. - example: - identity: - api_key: api_key - auth_token: auth_token - context: - key: context - location: location - id: - - id - - id - properties: - key: properties - vend_credentials: true - properties: - identity: - $ref: '#/components/schemas/Identity' - context: - additionalProperties: - type: string - description: | - Arbitrary context for a request as key-value pairs. - How to use the context is custom to the specific implementation. - - REST NAMESPACE ONLY - Context entries are passed via HTTP headers using the naming convention - `x-lance-ctx-: `. For example, a context entry - `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. - id: - items: - type: string - type: array - location: - description: | - Optional storage location for the table. - If not provided, the namespace implementation should determine the table location. - type: string - vend_credentials: - description: | - Whether to include vended credentials in the response `storage_options`. - When true, the implementation should provide vended credentials for accessing storage. - When not set, the implementation can decide whether to return vended credentials. - type: boolean - properties: - additionalProperties: - type: string - description: | - Properties stored on the table, if supported by the server. - CreateEmptyTableResponse: - deprecated: true - description: | - Response for creating an empty table. - - **Deprecated**: Use `DeclareTableResponse` instead. - example: - transaction_id: transaction_id - location: location - properties: - owner: Ralph - created_at: "1452120468" - storage_options: - key: storage_options - properties: - transaction_id: - description: Optional transaction identifier - type: string - location: - type: string - storage_options: - additionalProperties: - type: string - description: | - Configuration options to be used to access storage. The available - options depend on the type of storage in use. These will be - passed directly to Lance to initialize storage access. - properties: - additionalProperties: - type: string - default: {} - description: | - If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + Business logic properties stored and managed by the namespace implementation outside + Lance context. If the implementation does not support table properties, it should + return null for this field. example: owner: Ralph created_at: "1452120468" @@ -4670,7 +4591,8 @@ components: additionalProperties: type: string description: | - Properties stored on the table, if supported by the server. + Business logic properties stored and managed by the namespace implementation outside + Lance context, if supported by the implementation. DeclareTableResponse: description: | Response for declaring a table. diff --git a/java/lance-namespace-apache-client/docs/CreateEmptyTableRequest.md b/java/lance-namespace-apache-client/docs/CreateEmptyTableRequest.md deleted file mode 100644 index ed3845f46..000000000 --- a/java/lance-namespace-apache-client/docs/CreateEmptyTableRequest.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CreateEmptyTableRequest - -Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**identity** | [**Identity**](Identity.md) | | [optional] | -|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | -|**id** | **List<String>** | | [optional] | -|**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | -|**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | - - - diff --git a/java/lance-namespace-apache-client/docs/CreateEmptyTableResponse.md b/java/lance-namespace-apache-client/docs/CreateEmptyTableResponse.md deleted file mode 100644 index 39ce092a1..000000000 --- a/java/lance-namespace-apache-client/docs/CreateEmptyTableResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CreateEmptyTableResponse - -Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactionId** | **String** | Optional transaction identifier | [optional] | -|**location** | **String** | | [optional] | -|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | -|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | - - - diff --git a/java/lance-namespace-apache-client/docs/CreateTableRequest.md b/java/lance-namespace-apache-client/docs/CreateTableRequest.md index 38a18ebaf..c5ecc1ae0 100644 --- a/java/lance-namespace-apache-client/docs/CreateTableRequest.md +++ b/java/lance-namespace-apache-client/docs/CreateTableRequest.md @@ -2,7 +2,7 @@ # CreateTableRequest -Request for creating a table, excluding the Arrow IPC stream. +Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. ## Properties @@ -12,7 +12,8 @@ Request for creating a table, excluding the Arrow IPC stream. |**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | |**id** | **List<String>** | | [optional] | |**mode** | **String** | There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the implementation. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] | +|**storageOptions** | **Map<String, String>** | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. | [optional] | diff --git a/java/lance-namespace-apache-client/docs/CreateTableResponse.md b/java/lance-namespace-apache-client/docs/CreateTableResponse.md index 3997eb4d1..cfab4f158 100644 --- a/java/lance-namespace-apache-client/docs/CreateTableResponse.md +++ b/java/lance-namespace-apache-client/docs/CreateTableResponse.md @@ -11,7 +11,7 @@ |**location** | **String** | | [optional] | |**version** | **Long** | | [optional] | |**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | -|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. | [optional] | diff --git a/java/lance-namespace-apache-client/docs/DataApi.md b/java/lance-namespace-apache-client/docs/DataApi.md index e4cf46dd6..e714c8d5e 100644 --- a/java/lance-namespace-apache-client/docs/DataApi.md +++ b/java/lance-namespace-apache-client/docs/DataApi.md @@ -292,11 +292,11 @@ public class Example { ## createTable -> CreateTableResponse createTable(id, body, delimiter, mode) +> CreateTableResponse createTable(id, body, delimiter, mode, properties, storageOptions) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Example @@ -333,8 +333,10 @@ public class Example { byte[] body = null; // byte[] | Arrow IPC data String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. String mode = "mode_example"; // String | + String properties = "properties_example"; // String | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + String storageOptions = "storageOptions_example"; // String | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. try { - CreateTableResponse result = apiInstance.createTable(id, body, delimiter, mode); + CreateTableResponse result = apiInstance.createTable(id, body, delimiter, mode, properties, storageOptions); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DataApi#createTable"); @@ -356,6 +358,8 @@ public class Example { | **body** | **byte[]**| Arrow IPC data | | | **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | | **mode** | **String**| | [optional] | +| **properties** | **String**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] | +| **storageOptions** | **String**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] | ### Return type @@ -379,6 +383,7 @@ public class Example { | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | | **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | diff --git a/java/lance-namespace-apache-client/docs/DeclareTableRequest.md b/java/lance-namespace-apache-client/docs/DeclareTableRequest.md index 7a58a8315..1bc7858b3 100644 --- a/java/lance-namespace-apache-client/docs/DeclareTableRequest.md +++ b/java/lance-namespace-apache-client/docs/DeclareTableRequest.md @@ -13,7 +13,7 @@ Request for declaring a table. |**id** | **List<String>** | | [optional] | |**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | |**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] | diff --git a/java/lance-namespace-apache-client/docs/MetadataApi.md b/java/lance-namespace-apache-client/docs/MetadataApi.md index 37e39e415..98cbc4d31 100644 --- a/java/lance-namespace-apache-client/docs/MetadataApi.md +++ b/java/lance-namespace-apache-client/docs/MetadataApi.md @@ -10,7 +10,6 @@ All URIs are relative to *http://localhost:2333* | [**batchCommitTables**](MetadataApi.md#batchCommitTables) | **POST** /v1/table/batch-commit | Atomically commit a batch of mixed table operations | | [**batchCreateTableVersions**](MetadataApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | | [**batchDeleteTableVersions**](MetadataApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records | -| [**createEmptyTable**](MetadataApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table | | [**createNamespace**](MetadataApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace | | [**createTableIndex**](MetadataApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | | [**createTableScalarIndex**](MetadataApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | @@ -589,98 +588,6 @@ public class Example { | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | -## createEmptyTable - -> CreateEmptyTableResponse createEmptyTable(id, createEmptyTableRequest, delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Example - -```java -// Import classes: -import org.lance.namespace.client.apache.ApiClient; -import org.lance.namespace.client.apache.ApiException; -import org.lance.namespace.client.apache.Configuration; -import org.lance.namespace.client.apache.auth.*; -import org.lance.namespace.client.apache.models.*; -import org.lance.namespace.client.apache.api.MetadataApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:2333"); - - // Configure OAuth2 access token for authorization: OAuth2 - OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); - OAuth2.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure API key authorization: ApiKeyAuth - ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); - ApiKeyAuth.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //ApiKeyAuth.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: BearerAuth - HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); - BearerAuth.setBearerToken("BEARER TOKEN"); - - MetadataApi apiInstance = new MetadataApi(defaultClient); - String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | - String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - try { - CreateEmptyTableResponse result = apiInstance.createEmptyTable(id, createEmptyTableRequest, delimiter); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MetadataApi#createEmptyTable"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | -| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | -| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | - -### Return type - -[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md) - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Table properties result when creating an empty table | - | -| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -| **404** | A server-side problem that means can not find the specified resource. | - | -| **409** | The request conflicts with the current state of the target resource. | - | -| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - - ## createNamespace > CreateNamespaceResponse createNamespace(id, createNamespaceRequest, delimiter) diff --git a/java/lance-namespace-apache-client/docs/TableApi.md b/java/lance-namespace-apache-client/docs/TableApi.md index 79a229203..ecc317938 100644 --- a/java/lance-namespace-apache-client/docs/TableApi.md +++ b/java/lance-namespace-apache-client/docs/TableApi.md @@ -12,7 +12,6 @@ All URIs are relative to *http://localhost:2333* | [**batchCreateTableVersions**](TableApi.md#batchCreateTableVersions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | | [**batchDeleteTableVersions**](TableApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records | | [**countTableRows**](TableApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table | -| [**createEmptyTable**](TableApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table | | [**createTable**](TableApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name | | [**createTableIndex**](TableApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | | [**createTableScalarIndex**](TableApi.md#createTableScalarIndex) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table | @@ -774,105 +773,13 @@ public class Example { | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | -## createEmptyTable - -> CreateEmptyTableResponse createEmptyTable(id, createEmptyTableRequest, delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Example - -```java -// Import classes: -import org.lance.namespace.client.apache.ApiClient; -import org.lance.namespace.client.apache.ApiException; -import org.lance.namespace.client.apache.Configuration; -import org.lance.namespace.client.apache.auth.*; -import org.lance.namespace.client.apache.models.*; -import org.lance.namespace.client.apache.api.TableApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:2333"); - - // Configure OAuth2 access token for authorization: OAuth2 - OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); - OAuth2.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure API key authorization: ApiKeyAuth - ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); - ApiKeyAuth.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //ApiKeyAuth.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: BearerAuth - HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); - BearerAuth.setBearerToken("BEARER TOKEN"); - - TableApi apiInstance = new TableApi(defaultClient); - String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | - String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - try { - CreateEmptyTableResponse result = apiInstance.createEmptyTable(id, createEmptyTableRequest, delimiter); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TableApi#createEmptyTable"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | -| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | -| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | - -### Return type - -[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md) - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Table properties result when creating an empty table | - | -| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -| **404** | A server-side problem that means can not find the specified resource. | - | -| **409** | The request conflicts with the current state of the target resource. | - | -| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - - ## createTable -> CreateTableResponse createTable(id, body, delimiter, mode) +> CreateTableResponse createTable(id, body, delimiter, mode, properties, storageOptions) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Example @@ -909,8 +816,10 @@ public class Example { byte[] body = null; // byte[] | Arrow IPC data String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. String mode = "mode_example"; // String | + String properties = "properties_example"; // String | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + String storageOptions = "storageOptions_example"; // String | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. try { - CreateTableResponse result = apiInstance.createTable(id, body, delimiter, mode); + CreateTableResponse result = apiInstance.createTable(id, body, delimiter, mode, properties, storageOptions); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TableApi#createTable"); @@ -932,6 +841,8 @@ public class Example { | **body** | **byte[]**| Arrow IPC data | | | **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | | **mode** | **String**| | [optional] | +| **properties** | **String**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] | +| **storageOptions** | **String**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] | ### Return type @@ -955,6 +866,7 @@ public class Example { | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | | **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/DataApi.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/DataApi.java index fb70acd8b..8dd5f91e2 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/DataApi.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/DataApi.java @@ -372,7 +372,14 @@ public Long countTableRows( * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -383,12 +390,28 @@ public Long countTableRows( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return CreateTableResponse * @throws ApiException if fails to make API call */ - public CreateTableResponse createTable(String id, byte[] body, String delimiter, String mode) + public CreateTableResponse createTable( + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) throws ApiException { - return this.createTable(id, body, delimiter, mode, Collections.emptyMap()); + return this.createTable( + id, body, delimiter, mode, properties, storageOptions, Collections.emptyMap()); } /** @@ -397,7 +420,14 @@ public CreateTableResponse createTable(String id, byte[] body, String delimiter, * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -408,12 +438,27 @@ public CreateTableResponse createTable(String id, byte[] body, String delimiter, * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @param additionalHeaders additionalHeaders for this call * @return CreateTableResponse * @throws ApiException if fails to make API call */ public CreateTableResponse createTable( - String id, byte[] body, String delimiter, String mode, Map additionalHeaders) + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions, + Map additionalHeaders) throws ApiException { Object localVarPostBody = body; @@ -443,6 +488,8 @@ public CreateTableResponse createTable( localVarQueryParams.addAll(apiClient.parameterToPair("delimiter", delimiter)); localVarQueryParams.addAll(apiClient.parameterToPair("mode", mode)); + localVarQueryParams.addAll(apiClient.parameterToPair("properties", properties)); + localVarQueryParams.addAll(apiClient.parameterToPair("storage_options", storageOptions)); localVarHeaderParams.putAll(additionalHeaders); diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/MetadataApi.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/MetadataApi.java index c8bbe7a59..cb8fc3c10 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/MetadataApi.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/MetadataApi.java @@ -30,8 +30,6 @@ import org.lance.namespace.model.BatchCreateTableVersionsResponse; import org.lance.namespace.model.BatchDeleteTableVersionsRequest; import org.lance.namespace.model.BatchDeleteTableVersionsResponse; -import org.lance.namespace.model.CreateEmptyTableRequest; -import org.lance.namespace.model.CreateEmptyTableResponse; import org.lance.namespace.model.CreateNamespaceRequest; import org.lance.namespace.model.CreateNamespaceResponse; import org.lance.namespace.model.CreateTableIndexRequest; @@ -705,118 +703,6 @@ public BatchDeleteTableVersionsResponse batchDeleteTableVersions( localVarReturnType); } - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return CreateEmptyTableResponse - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CreateEmptyTableResponse createEmptyTable( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - return this.createEmptyTable(id, createEmptyTableRequest, delimiter, Collections.emptyMap()); - } - - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @param additionalHeaders additionalHeaders for this call - * @return CreateEmptyTableResponse - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CreateEmptyTableResponse createEmptyTable( - String id, - CreateEmptyTableRequest createEmptyTableRequest, - String delimiter, - Map additionalHeaders) - throws ApiException { - Object localVarPostBody = createEmptyTableRequest; - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, "Missing the required parameter 'id' when calling createEmptyTable"); - } - - // verify the required parameter 'createEmptyTableRequest' is set - if (createEmptyTableRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'createEmptyTableRequest' when calling createEmptyTable"); - } - - // create path and map variables - String localVarPath = - "/v1/table/{id}/create-empty" - .replaceAll( - "\\{" + "id" + "\\}", apiClient.escapeString(apiClient.parameterToString(id))); - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPair("delimiter", delimiter)); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] {"OAuth2", "ApiKeyAuth", "BearerAuth"}; - - TypeReference localVarReturnType = - new TypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - /** * Create a new namespace Create new namespace `id`. During the creation process, the * implementation may modify user-provided `properties`, such as adding additional diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/TableApi.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/TableApi.java index e4c6390bb..a652840cf 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/TableApi.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/client/apache/api/TableApi.java @@ -32,8 +32,6 @@ import org.lance.namespace.model.BatchDeleteTableVersionsRequest; import org.lance.namespace.model.BatchDeleteTableVersionsResponse; import org.lance.namespace.model.CountTableRowsRequest; -import org.lance.namespace.model.CreateEmptyTableRequest; -import org.lance.namespace.model.CreateEmptyTableResponse; import org.lance.namespace.model.CreateTableIndexRequest; import org.lance.namespace.model.CreateTableIndexResponse; import org.lance.namespace.model.CreateTableResponse; @@ -914,125 +912,20 @@ public Long countTableRows( localVarReturnType); } - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return CreateEmptyTableResponse - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CreateEmptyTableResponse createEmptyTable( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - return this.createEmptyTable(id, createEmptyTableRequest, delimiter, Collections.emptyMap()); - } - - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @param additionalHeaders additionalHeaders for this call - * @return CreateEmptyTableResponse - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CreateEmptyTableResponse createEmptyTable( - String id, - CreateEmptyTableRequest createEmptyTableRequest, - String delimiter, - Map additionalHeaders) - throws ApiException { - Object localVarPostBody = createEmptyTableRequest; - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, "Missing the required parameter 'id' when calling createEmptyTable"); - } - - // verify the required parameter 'createEmptyTableRequest' is set - if (createEmptyTableRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'createEmptyTableRequest' when calling createEmptyTable"); - } - - // create path and map variables - String localVarPath = - "/v1/table/{id}/create-empty" - .replaceAll( - "\\{" + "id" + "\\}", apiClient.escapeString(apiClient.parameterToString(id))); - - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPair("delimiter", delimiter)); - - localVarHeaderParams.putAll(additionalHeaders); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] {"OAuth2", "ApiKeyAuth", "BearerAuth"}; - - TypeReference localVarReturnType = - new TypeReference() {}; - return apiClient.invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType); - } - /** * Create a table with the given name Create table `id` in the namespace with the given * data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -1043,12 +936,28 @@ public CreateEmptyTableResponse createEmptyTable( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return CreateTableResponse * @throws ApiException if fails to make API call */ - public CreateTableResponse createTable(String id, byte[] body, String delimiter, String mode) + public CreateTableResponse createTable( + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) throws ApiException { - return this.createTable(id, body, delimiter, mode, Collections.emptyMap()); + return this.createTable( + id, body, delimiter, mode, properties, storageOptions, Collections.emptyMap()); } /** @@ -1057,7 +966,14 @@ public CreateTableResponse createTable(String id, byte[] body, String delimiter, * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -1068,12 +984,27 @@ public CreateTableResponse createTable(String id, byte[] body, String delimiter, * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @param additionalHeaders additionalHeaders for this call * @return CreateTableResponse * @throws ApiException if fails to make API call */ public CreateTableResponse createTable( - String id, byte[] body, String delimiter, String mode, Map additionalHeaders) + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions, + Map additionalHeaders) throws ApiException { Object localVarPostBody = body; @@ -1103,6 +1034,8 @@ public CreateTableResponse createTable( localVarQueryParams.addAll(apiClient.parameterToPair("delimiter", delimiter)); localVarQueryParams.addAll(apiClient.parameterToPair("mode", mode)); + localVarQueryParams.addAll(apiClient.parameterToPair("properties", properties)); + localVarQueryParams.addAll(apiClient.parameterToPair("storage_options", storageOptions)); localVarHeaderParams.putAll(additionalHeaders); diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java deleted file mode 100644 index 8bf2c730d..000000000 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.lance.namespace.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.StringJoiner; - -/** - * Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - CreateEmptyTableRequest.JSON_PROPERTY_IDENTITY, - CreateEmptyTableRequest.JSON_PROPERTY_CONTEXT, - CreateEmptyTableRequest.JSON_PROPERTY_ID, - CreateEmptyTableRequest.JSON_PROPERTY_LOCATION, - CreateEmptyTableRequest.JSON_PROPERTY_VEND_CREDENTIALS, - CreateEmptyTableRequest.JSON_PROPERTY_PROPERTIES -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class CreateEmptyTableRequest { - public static final String JSON_PROPERTY_IDENTITY = "identity"; - @javax.annotation.Nullable private Identity identity; - - public static final String JSON_PROPERTY_CONTEXT = "context"; - @javax.annotation.Nullable private Map context = new HashMap<>(); - - public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable private List id = new ArrayList<>(); - - public static final String JSON_PROPERTY_LOCATION = "location"; - @javax.annotation.Nullable private String location; - - public static final String JSON_PROPERTY_VEND_CREDENTIALS = "vend_credentials"; - @javax.annotation.Nullable private Boolean vendCredentials; - - public static final String JSON_PROPERTY_PROPERTIES = "properties"; - @javax.annotation.Nullable private Map properties = new HashMap<>(); - - public CreateEmptyTableRequest() {} - - public CreateEmptyTableRequest identity(@javax.annotation.Nullable Identity identity) { - - this.identity = identity; - return this; - } - - /** - * Get identity - * - * @return identity - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IDENTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Identity getIdentity() { - return identity; - } - - @JsonProperty(JSON_PROPERTY_IDENTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIdentity(@javax.annotation.Nullable Identity identity) { - this.identity = identity; - } - - public CreateEmptyTableRequest context(@javax.annotation.Nullable Map context) { - - this.context = context; - return this; - } - - public CreateEmptyTableRequest putContextItem(String key, String contextItem) { - if (this.context == null) { - this.context = new HashMap<>(); - } - this.context.put(key, contextItem); - return this; - } - - /** - * Arbitrary context for a request as key-value pairs. How to use the context is custom to the - * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using - * the naming convention `x-lance-ctx-<key>: <value>`. For example, a - * context entry `{\"trace_id\": \"abc123\"}` would be sent as the - * header `x-lance-ctx-trace_id: abc123`. - * - * @return context - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CONTEXT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getContext() { - return context; - } - - @JsonProperty(JSON_PROPERTY_CONTEXT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setContext(@javax.annotation.Nullable Map context) { - this.context = context; - } - - public CreateEmptyTableRequest id(@javax.annotation.Nullable List id) { - - this.id = id; - return this; - } - - public CreateEmptyTableRequest addIdItem(String idItem) { - if (this.id == null) { - this.id = new ArrayList<>(); - } - this.id.add(idItem); - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable List id) { - this.id = id; - } - - public CreateEmptyTableRequest location(@javax.annotation.Nullable String location) { - - this.location = location; - return this; - } - - /** - * Optional storage location for the table. If not provided, the namespace implementation should - * determine the table location. - * - * @return location - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocation() { - return location; - } - - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocation(@javax.annotation.Nullable String location) { - this.location = location; - } - - public CreateEmptyTableRequest vendCredentials( - @javax.annotation.Nullable Boolean vendCredentials) { - - this.vendCredentials = vendCredentials; - return this; - } - - /** - * Whether to include vended credentials in the response `storage_options`. When true, - * the implementation should provide vended credentials for accessing storage. When not set, the - * implementation can decide whether to return vended credentials. - * - * @return vendCredentials - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getVendCredentials() { - return vendCredentials; - } - - @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { - this.vendCredentials = vendCredentials; - } - - public CreateEmptyTableRequest properties( - @javax.annotation.Nullable Map properties) { - - this.properties = properties; - return this; - } - - public CreateEmptyTableRequest putPropertiesItem(String key, String propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * Properties stored on the table, if supported by the server. - * - * @return properties - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getProperties() { - return properties; - } - - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperties(@javax.annotation.Nullable Map properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEmptyTableRequest createEmptyTableRequest = (CreateEmptyTableRequest) o; - return Objects.equals(this.identity, createEmptyTableRequest.identity) - && Objects.equals(this.context, createEmptyTableRequest.context) - && Objects.equals(this.id, createEmptyTableRequest.id) - && Objects.equals(this.location, createEmptyTableRequest.location) - && Objects.equals(this.vendCredentials, createEmptyTableRequest.vendCredentials) - && Objects.equals(this.properties, createEmptyTableRequest.properties); - } - - @Override - public int hashCode() { - return Objects.hash(identity, context, id, location, vendCredentials, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEmptyTableRequest {\n"); - sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" vendCredentials: ").append(toIndentedString(vendCredentials)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `identity` to the URL query string - if (getIdentity() != null) { - joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); - } - - // add `context` to the URL query string - if (getContext() != null) { - for (String _key : getContext().keySet()) { - try { - joiner.add( - String.format( - "%scontext%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getContext().get(_key), - URLEncoder.encode(String.valueOf(getContext().get(_key)), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - } - - // add `id` to the URL query string - if (getId() != null) { - for (int i = 0; i < getId().size(); i++) { - try { - joiner.add( - String.format( - "%sid%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getId().get(i)), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - } - - // add `location` to the URL query string - if (getLocation() != null) { - try { - joiner.add( - String.format( - "%slocation%s=%s", - prefix, - suffix, - URLEncoder.encode(String.valueOf(getLocation()), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `vend_credentials` to the URL query string - if (getVendCredentials() != null) { - try { - joiner.add( - String.format( - "%svend_credentials%s=%s", - prefix, - suffix, - URLEncoder.encode(String.valueOf(getVendCredentials()), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `properties` to the URL query string - if (getProperties() != null) { - for (String _key : getProperties().keySet()) { - try { - joiner.add( - String.format( - "%sproperties%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getProperties().get(_key), - URLEncoder.encode(String.valueOf(getProperties().get(_key)), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - } - - return joiner.toString(); - } -} diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java deleted file mode 100644 index cbd193f7a..000000000 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.lance.namespace.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.StringJoiner; - -/** - * Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` - * instead. - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - CreateEmptyTableResponse.JSON_PROPERTY_TRANSACTION_ID, - CreateEmptyTableResponse.JSON_PROPERTY_LOCATION, - CreateEmptyTableResponse.JSON_PROPERTY_STORAGE_OPTIONS, - CreateEmptyTableResponse.JSON_PROPERTY_PROPERTIES -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class CreateEmptyTableResponse { - public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; - @javax.annotation.Nullable private String transactionId; - - public static final String JSON_PROPERTY_LOCATION = "location"; - @javax.annotation.Nullable private String location; - - public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; - @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); - - public static final String JSON_PROPERTY_PROPERTIES = "properties"; - @javax.annotation.Nullable private Map properties = new HashMap<>(); - - public CreateEmptyTableResponse() {} - - public CreateEmptyTableResponse transactionId(@javax.annotation.Nullable String transactionId) { - - this.transactionId = transactionId; - return this; - } - - /** - * Optional transaction identifier - * - * @return transactionId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTransactionId() { - return transactionId; - } - - @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTransactionId(@javax.annotation.Nullable String transactionId) { - this.transactionId = transactionId; - } - - public CreateEmptyTableResponse location(@javax.annotation.Nullable String location) { - - this.location = location; - return this; - } - - /** - * Get location - * - * @return location - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocation() { - return location; - } - - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocation(@javax.annotation.Nullable String location) { - this.location = location; - } - - public CreateEmptyTableResponse storageOptions( - @javax.annotation.Nullable Map storageOptions) { - - this.storageOptions = storageOptions; - return this; - } - - public CreateEmptyTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { - if (this.storageOptions == null) { - this.storageOptions = new HashMap<>(); - } - this.storageOptions.put(key, storageOptionsItem); - return this; - } - - /** - * Configuration options to be used to access storage. The available options depend on the type of - * storage in use. These will be passed directly to Lance to initialize storage access. - * - * @return storageOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getStorageOptions() { - return storageOptions; - } - - @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { - this.storageOptions = storageOptions; - } - - public CreateEmptyTableResponse properties( - @javax.annotation.Nullable Map properties) { - - this.properties = properties; - return this; - } - - public CreateEmptyTableResponse putPropertiesItem(String key, String propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * If the implementation does not support table properties, it should return null for this field. - * Otherwise it should return the properties. - * - * @return properties - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getProperties() { - return properties; - } - - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperties(@javax.annotation.Nullable Map properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEmptyTableResponse createEmptyTableResponse = (CreateEmptyTableResponse) o; - return Objects.equals(this.transactionId, createEmptyTableResponse.transactionId) - && Objects.equals(this.location, createEmptyTableResponse.location) - && Objects.equals(this.storageOptions, createEmptyTableResponse.storageOptions) - && Objects.equals(this.properties, createEmptyTableResponse.properties); - } - - @Override - public int hashCode() { - return Objects.hash(transactionId, location, storageOptions, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEmptyTableResponse {\n"); - sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `transaction_id` to the URL query string - if (getTransactionId() != null) { - try { - joiner.add( - String.format( - "%stransaction_id%s=%s", - prefix, - suffix, - URLEncoder.encode(String.valueOf(getTransactionId()), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `location` to the URL query string - if (getLocation() != null) { - try { - joiner.add( - String.format( - "%slocation%s=%s", - prefix, - suffix, - URLEncoder.encode(String.valueOf(getLocation()), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `storage_options` to the URL query string - if (getStorageOptions() != null) { - for (String _key : getStorageOptions().keySet()) { - try { - joiner.add( - String.format( - "%sstorage_options%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getStorageOptions().get(_key), - URLEncoder.encode(String.valueOf(getStorageOptions().get(_key)), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - } - - // add `properties` to the URL query string - if (getProperties() != null) { - for (String _key : getProperties().keySet()) { - try { - joiner.add( - String.format( - "%sproperties%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getProperties().get(_key), - URLEncoder.encode(String.valueOf(getProperties().get(_key)), "UTF-8") - .replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - } - - return joiner.toString(); - } -} diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java index 45e912380..f52f4bca1 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java @@ -26,13 +26,18 @@ import java.util.Objects; import java.util.StringJoiner; -/** Request for creating a table, excluding the Arrow IPC stream. */ +/** + * Request for creating a table, excluding the Arrow IPC stream. The table location and any + * credential vending behavior are determined by the implementation and returned in the response, + * rather than specified in this request. + */ @JsonPropertyOrder({ CreateTableRequest.JSON_PROPERTY_IDENTITY, CreateTableRequest.JSON_PROPERTY_CONTEXT, CreateTableRequest.JSON_PROPERTY_ID, CreateTableRequest.JSON_PROPERTY_MODE, - CreateTableRequest.JSON_PROPERTY_PROPERTIES + CreateTableRequest.JSON_PROPERTY_PROPERTIES, + CreateTableRequest.JSON_PROPERTY_STORAGE_OPTIONS }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -53,6 +58,9 @@ public class CreateTableRequest { public static final String JSON_PROPERTY_PROPERTIES = "properties"; @javax.annotation.Nullable private Map properties = new HashMap<>(); + public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; + @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); + public CreateTableRequest() {} public CreateTableRequest identity(@javax.annotation.Nullable Identity identity) { @@ -190,7 +198,8 @@ public CreateTableRequest putPropertiesItem(String key, String propertiesItem) { } /** - * Properties stored on the table, if supported by the implementation. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context, if supported by the implementation. * * @return properties */ @@ -207,6 +216,40 @@ public void setProperties(@javax.annotation.Nullable Map propert this.properties = properties; } + public CreateTableRequest storageOptions( + @javax.annotation.Nullable Map storageOptions) { + + this.storageOptions = storageOptions; + return this; + } + + public CreateTableRequest putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Storage options that configure overrides for writing table data and metadata during table + * creation. These are passed to Lance for the write path. + * + * @return storageOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getStorageOptions() { + return storageOptions; + } + + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -220,12 +263,13 @@ public boolean equals(Object o) { && Objects.equals(this.context, createTableRequest.context) && Objects.equals(this.id, createTableRequest.id) && Objects.equals(this.mode, createTableRequest.mode) - && Objects.equals(this.properties, createTableRequest.properties); + && Objects.equals(this.properties, createTableRequest.properties) + && Objects.equals(this.storageOptions, createTableRequest.storageOptions); } @Override public int hashCode() { - return Objects.hash(identity, context, id, mode, properties); + return Objects.hash(identity, context, id, mode, properties, storageOptions); } @Override @@ -237,6 +281,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); sb.append("}"); return sb.toString(); } @@ -368,6 +413,28 @@ public String toUrlQueryString(String prefix) { } } + // add `storage_options` to the URL query string + if (getStorageOptions() != null) { + for (String _key : getStorageOptions().keySet()) { + try { + joiner.add( + String.format( + "%sstorage_options%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getStorageOptions().get(_key), + URLEncoder.encode(String.valueOf(getStorageOptions().get(_key)), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + return joiner.toString(); } } diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java index 9d3b5196a..926dade5e 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java @@ -174,8 +174,9 @@ public CreateTableResponse putPropertiesItem(String key, String propertiesItem) } /** - * If the implementation does not support table properties, it should return null for this field. - * Otherwise it should return the properties. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context. If the implementation does not support table properties, it should return null for + * this field. * * @return properties */ diff --git a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java index 462ce2efb..6d1f1f8a1 100644 --- a/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java +++ b/java/lance-namespace-apache-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java @@ -217,7 +217,8 @@ public DeclareTableRequest putPropertiesItem(String key, String propertiesItem) } /** - * Properties stored on the table, if supported by the server. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context, if supported by the implementation. * * @return properties */ diff --git a/java/lance-namespace-async-client/README.md b/java/lance-namespace-async-client/README.md index 332100012..c69ab78fc 100644 --- a/java/lance-namespace-async-client/README.md +++ b/java/lance-namespace-async-client/README.md @@ -161,8 +161,6 @@ Class | Method | HTTP request | Description *MetadataApi* | [**batchCreateTableVersionsWithHttpInfo**](docs/MetadataApi.md#batchCreateTableVersionsWithHttpInfo) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *MetadataApi* | [**batchDeleteTableVersions**](docs/MetadataApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records *MetadataApi* | [**batchDeleteTableVersionsWithHttpInfo**](docs/MetadataApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records -*MetadataApi* | [**createEmptyTable**](docs/MetadataApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table -*MetadataApi* | [**createEmptyTableWithHttpInfo**](docs/MetadataApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table *MetadataApi* | [**createNamespace**](docs/MetadataApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace *MetadataApi* | [**createNamespaceWithHttpInfo**](docs/MetadataApi.md#createNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/create | Create a new namespace *MetadataApi* | [**createTableIndex**](docs/MetadataApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table @@ -251,8 +249,6 @@ Class | Method | HTTP request | Description *TableApi* | [**batchDeleteTableVersionsWithHttpInfo**](docs/TableApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records *TableApi* | [**countTableRows**](docs/TableApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table *TableApi* | [**countTableRowsWithHttpInfo**](docs/TableApi.md#countTableRowsWithHttpInfo) | **POST** /v1/table/{id}/count_rows | Count rows in a table -*TableApi* | [**createEmptyTable**](docs/TableApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table -*TableApi* | [**createEmptyTableWithHttpInfo**](docs/TableApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table *TableApi* | [**createTable**](docs/TableApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name *TableApi* | [**createTableWithHttpInfo**](docs/TableApi.md#createTableWithHttpInfo) | **POST** /v1/table/{id}/create | Create a table with the given name *TableApi* | [**createTableIndex**](docs/TableApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table @@ -365,8 +361,6 @@ Class | Method | HTTP request | Description - [CommitTableOperation](docs/CommitTableOperation.md) - [CommitTableResult](docs/CommitTableResult.md) - [CountTableRowsRequest](docs/CountTableRowsRequest.md) - - [CreateEmptyTableRequest](docs/CreateEmptyTableRequest.md) - - [CreateEmptyTableResponse](docs/CreateEmptyTableResponse.md) - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [CreateTableIndexRequest](docs/CreateTableIndexRequest.md) diff --git a/java/lance-namespace-async-client/api/openapi.yaml b/java/lance-namespace-async-client/api/openapi.yaml index 00cbcda75..0bbd07a4e 100644 --- a/java/lance-namespace-async-client/api/openapi.yaml +++ b/java/lance-namespace-async-client/api/openapi.yaml @@ -1565,6 +1565,29 @@ paths: schema: type: string style: form + - description: | + Business logic properties managed by the namespace implementation outside Lance context. + The map is translated to a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`. + explode: true + in: query + name: properties + required: false + schema: + type: string + style: form + - description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. + The map is translated to a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`. + explode: true + in: query + name: storage_options + required: false + schema: + type: string + style: form post: description: | Create table `id` in the namespace with the given data in Arrow IPC stream. @@ -1577,6 +1600,12 @@ paths: It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + - `properties`: serialize as a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`; these are business logic properties + managed by the namespace implementation outside Lance context + - `storage_options`: serialize as a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure + write-time overrides for data and metadata written during table creation operationId: CreateTable parameters: - $ref: '#/components/parameters/id' @@ -1588,6 +1617,29 @@ paths: schema: type: string style: form + - description: | + Business logic properties managed by the namespace implementation outside Lance context. + The map is translated to a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`. + explode: true + in: query + name: properties + required: false + schema: + type: string + style: form + - description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. + The map is translated to a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`. + explode: true + in: query + name: storage_options + required: false + schema: + type: string + style: form requestBody: content: application/vnd.apache.arrow.stream: @@ -1607,6 +1659,8 @@ paths: $ref: '#/components/responses/ForbiddenErrorResponse' "404": $ref: '#/components/responses/NotFoundErrorResponse' + "409": + $ref: '#/components/responses/ConflictErrorResponse' "503": $ref: '#/components/responses/ServiceUnavailableErrorResponse' "5XX": @@ -2119,54 +2173,6 @@ paths: x-content-type: application/json x-accepts: - application/json - /v1/table/{id}/create-empty: - parameters: - - $ref: '#/components/parameters/id' - - $ref: '#/components/parameters/delimiter' - post: - deprecated: true - description: | - Create an empty table with the given name without touching storage. - This is a metadata-only operation that records the table existence and sets up aspects like access control. - - For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory - to mark the table's existence without creating actual Lance data files. - - **Deprecated**: Use `DeclareTable` instead. - operationId: CreateEmptyTable - parameters: - - $ref: '#/components/parameters/id' - - $ref: '#/components/parameters/delimiter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEmptyTableRequest' - required: true - responses: - "200": - $ref: '#/components/responses/CreateEmptyTableResponse' - "400": - $ref: '#/components/responses/BadRequestErrorResponse' - "401": - $ref: '#/components/responses/UnauthorizedErrorResponse' - "403": - $ref: '#/components/responses/ForbiddenErrorResponse' - "404": - $ref: '#/components/responses/NotFoundErrorResponse' - "409": - $ref: '#/components/responses/ConflictErrorResponse' - "503": - $ref: '#/components/responses/ServiceUnavailableErrorResponse' - "5XX": - $ref: '#/components/responses/ServerErrorResponse' - summary: Create an empty table - tags: - - Table - - Metadata - x-content-type: application/json - x-accepts: - - application/json /v1/table/{id}/tags/create: parameters: - $ref: '#/components/parameters/id' @@ -2715,12 +2721,6 @@ components: schema: $ref: '#/components/schemas/DeclareTableResponse' description: Table properties result when declaring a table - CreateEmptyTableResponse: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEmptyTableResponse' - description: Table properties result when creating an empty table BadRequestErrorResponse: content: application/json: @@ -4462,6 +4462,8 @@ components: CreateTableRequest: description: | Request for creating a table, excluding the Arrow IPC stream. + The table location and any credential vending behavior are determined by the implementation + and returned in the response, rather than specified in this request. properties: identity: $ref: '#/components/schemas/Identity' @@ -4493,7 +4495,14 @@ components: additionalProperties: type: string description: | - Properties stored on the table, if supported by the implementation. + Business logic properties stored and managed by the namespace implementation outside + Lance context, if supported by the implementation. + storage_options: + additionalProperties: + type: string + description: | + Storage options that configure overrides for writing table data and metadata during + table creation. These are passed to Lance for the write path. CreateTableResponse: example: transaction_id: transaction_id @@ -4526,97 +4535,9 @@ components: type: string default: {} description: | - If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. - example: - owner: Ralph - created_at: "1452120468" - nullable: true - CreateEmptyTableRequest: - deprecated: true - description: | - Request for creating an empty table. - - **Deprecated**: Use `DeclareTableRequest` instead. - example: - identity: - api_key: api_key - auth_token: auth_token - context: - key: context - location: location - id: - - id - - id - properties: - key: properties - vend_credentials: true - properties: - identity: - $ref: '#/components/schemas/Identity' - context: - additionalProperties: - type: string - description: | - Arbitrary context for a request as key-value pairs. - How to use the context is custom to the specific implementation. - - REST NAMESPACE ONLY - Context entries are passed via HTTP headers using the naming convention - `x-lance-ctx-: `. For example, a context entry - `{"trace_id": "abc123"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. - id: - items: - type: string - type: array - location: - description: | - Optional storage location for the table. - If not provided, the namespace implementation should determine the table location. - type: string - vend_credentials: - description: | - Whether to include vended credentials in the response `storage_options`. - When true, the implementation should provide vended credentials for accessing storage. - When not set, the implementation can decide whether to return vended credentials. - type: boolean - properties: - additionalProperties: - type: string - description: | - Properties stored on the table, if supported by the server. - CreateEmptyTableResponse: - deprecated: true - description: | - Response for creating an empty table. - - **Deprecated**: Use `DeclareTableResponse` instead. - example: - transaction_id: transaction_id - location: location - properties: - owner: Ralph - created_at: "1452120468" - storage_options: - key: storage_options - properties: - transaction_id: - description: Optional transaction identifier - type: string - location: - type: string - storage_options: - additionalProperties: - type: string - description: | - Configuration options to be used to access storage. The available - options depend on the type of storage in use. These will be - passed directly to Lance to initialize storage access. - properties: - additionalProperties: - type: string - default: {} - description: | - If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + Business logic properties stored and managed by the namespace implementation outside + Lance context. If the implementation does not support table properties, it should + return null for this field. example: owner: Ralph created_at: "1452120468" @@ -4670,7 +4591,8 @@ components: additionalProperties: type: string description: | - Properties stored on the table, if supported by the server. + Business logic properties stored and managed by the namespace implementation outside + Lance context, if supported by the implementation. DeclareTableResponse: description: | Response for declaring a table. diff --git a/java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md b/java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md deleted file mode 100644 index ed3845f46..000000000 --- a/java/lance-namespace-async-client/docs/CreateEmptyTableRequest.md +++ /dev/null @@ -1,19 +0,0 @@ - - -# CreateEmptyTableRequest - -Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**identity** | [**Identity**](Identity.md) | | [optional] | -|**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | -|**id** | **List<String>** | | [optional] | -|**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | -|**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | - - - diff --git a/java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md b/java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md deleted file mode 100644 index 39ce092a1..000000000 --- a/java/lance-namespace-async-client/docs/CreateEmptyTableResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# CreateEmptyTableResponse - -Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**transactionId** | **String** | Optional transaction identifier | [optional] | -|**location** | **String** | | [optional] | -|**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | -|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | - - - diff --git a/java/lance-namespace-async-client/docs/CreateTableRequest.md b/java/lance-namespace-async-client/docs/CreateTableRequest.md index 38a18ebaf..c5ecc1ae0 100644 --- a/java/lance-namespace-async-client/docs/CreateTableRequest.md +++ b/java/lance-namespace-async-client/docs/CreateTableRequest.md @@ -2,7 +2,7 @@ # CreateTableRequest -Request for creating a table, excluding the Arrow IPC stream. +Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. ## Properties @@ -12,7 +12,8 @@ Request for creating a table, excluding the Arrow IPC stream. |**context** | **Map<String, String>** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] | |**id** | **List<String>** | | [optional] | |**mode** | **String** | There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the implementation. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] | +|**storageOptions** | **Map<String, String>** | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. | [optional] | diff --git a/java/lance-namespace-async-client/docs/CreateTableResponse.md b/java/lance-namespace-async-client/docs/CreateTableResponse.md index 3997eb4d1..cfab4f158 100644 --- a/java/lance-namespace-async-client/docs/CreateTableResponse.md +++ b/java/lance-namespace-async-client/docs/CreateTableResponse.md @@ -11,7 +11,7 @@ |**location** | **String** | | [optional] | |**version** | **Long** | | [optional] | |**storageOptions** | **Map<String, String>** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] | -|**properties** | **Map<String, String>** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. | [optional] | diff --git a/java/lance-namespace-async-client/docs/DataApi.md b/java/lance-namespace-async-client/docs/DataApi.md index 2d09b42c0..fe8440723 100644 --- a/java/lance-namespace-async-client/docs/DataApi.md +++ b/java/lance-namespace-async-client/docs/DataApi.md @@ -608,11 +608,11 @@ CompletableFuture> ## createTable -> CompletableFuture createTable(id, body, delimiter, mode) +> CompletableFuture createTable(id, body, delimiter, mode, properties, storageOptions) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Example @@ -650,8 +650,10 @@ public class Example { byte[] body = null; // byte[] | Arrow IPC data String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. String mode = "mode_example"; // String | + String properties = "properties_example"; // String | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + String storageOptions = "storageOptions_example"; // String | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. try { - CompletableFuture result = apiInstance.createTable(id, body, delimiter, mode); + CompletableFuture result = apiInstance.createTable(id, body, delimiter, mode, properties, storageOptions); System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling DataApi#createTable"); @@ -673,6 +675,8 @@ public class Example { | **body** | **byte[]**| Arrow IPC data | | | **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | | **mode** | **String**| | [optional] | +| **properties** | **String**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] | +| **storageOptions** | **String**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] | ### Return type @@ -696,16 +700,17 @@ CompletableFuture<[**CreateTableResponse**](CreateTableResponse.md)> | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | | **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | ## createTableWithHttpInfo -> CompletableFuture> createTable createTableWithHttpInfo(id, body, delimiter, mode) +> CompletableFuture> createTable createTableWithHttpInfo(id, body, delimiter, mode, properties, storageOptions) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Example @@ -744,8 +749,10 @@ public class Example { byte[] body = null; // byte[] | Arrow IPC data String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. String mode = "mode_example"; // String | + String properties = "properties_example"; // String | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + String storageOptions = "storageOptions_example"; // String | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. try { - CompletableFuture> response = apiInstance.createTableWithHttpInfo(id, body, delimiter, mode); + CompletableFuture> response = apiInstance.createTableWithHttpInfo(id, body, delimiter, mode, properties, storageOptions); System.out.println("Status code: " + response.get().getStatusCode()); System.out.println("Response headers: " + response.get().getHeaders()); System.out.println("Response body: " + response.get().getData()); @@ -776,6 +783,8 @@ public class Example { | **body** | **byte[]**| Arrow IPC data | | | **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | | **mode** | **String**| | [optional] | +| **properties** | **String**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] | +| **storageOptions** | **String**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] | ### Return type @@ -799,6 +808,7 @@ CompletableFuture | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | | **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | diff --git a/java/lance-namespace-async-client/docs/DeclareTableRequest.md b/java/lance-namespace-async-client/docs/DeclareTableRequest.md index 7a58a8315..1bc7858b3 100644 --- a/java/lance-namespace-async-client/docs/DeclareTableRequest.md +++ b/java/lance-namespace-async-client/docs/DeclareTableRequest.md @@ -13,7 +13,7 @@ Request for declaring a table. |**id** | **List<String>** | | [optional] | |**location** | **String** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] | |**vendCredentials** | **Boolean** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] | -|**properties** | **Map<String, String>** | Properties stored on the table, if supported by the server. | [optional] | +|**properties** | **Map<String, String>** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] | diff --git a/java/lance-namespace-async-client/docs/MetadataApi.md b/java/lance-namespace-async-client/docs/MetadataApi.md index b909a9a57..094fe10c5 100644 --- a/java/lance-namespace-async-client/docs/MetadataApi.md +++ b/java/lance-namespace-async-client/docs/MetadataApi.md @@ -16,8 +16,6 @@ All URIs are relative to *http://localhost:2333* | [**batchCreateTableVersionsWithHttpInfo**](MetadataApi.md#batchCreateTableVersionsWithHttpInfo) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables | | [**batchDeleteTableVersions**](MetadataApi.md#batchDeleteTableVersions) | **POST** /v1/table/{id}/version/delete | Delete table version records | | [**batchDeleteTableVersionsWithHttpInfo**](MetadataApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records | -| [**createEmptyTable**](MetadataApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table | -| [**createEmptyTableWithHttpInfo**](MetadataApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table | | [**createNamespace**](MetadataApi.md#createNamespace) | **POST** /v1/namespace/{id}/create | Create a new namespace | | [**createNamespaceWithHttpInfo**](MetadataApi.md#createNamespaceWithHttpInfo) | **POST** /v1/namespace/{id}/create | Create a new namespace | | [**createTableIndex**](MetadataApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | @@ -1237,201 +1235,6 @@ CompletableFuture CompletableFuture createEmptyTable(id, createEmptyTableRequest, delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Example - -```java -// Import classes: -import org.lance.namespace.client.async.ApiClient; -import org.lance.namespace.client.async.ApiException; -import org.lance.namespace.client.async.Configuration; -import org.lance.namespace.client.async.auth.*; -import org.lance.namespace.client.async.models.*; -import org.lance.namespace.client.async.api.MetadataApi; -import java.util.concurrent.CompletableFuture; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:2333"); - - // Configure OAuth2 access token for authorization: OAuth2 - OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); - OAuth2.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure API key authorization: ApiKeyAuth - ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); - ApiKeyAuth.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //ApiKeyAuth.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: BearerAuth - HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); - BearerAuth.setBearerToken("BEARER TOKEN"); - - MetadataApi apiInstance = new MetadataApi(defaultClient); - String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | - String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - try { - CompletableFuture result = apiInstance.createEmptyTable(id, createEmptyTableRequest, delimiter); - System.out.println(result.get()); - } catch (ApiException e) { - System.err.println("Exception when calling MetadataApi#createEmptyTable"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | -| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | -| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | - -### Return type - -CompletableFuture<[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md)> - - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Table properties result when creating an empty table | - | -| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -| **404** | A server-side problem that means can not find the specified resource. | - | -| **409** | The request conflicts with the current state of the target resource. | - | -| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - -## createEmptyTableWithHttpInfo - -> CompletableFuture> createEmptyTable createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Example - -```java -// Import classes: -import org.lance.namespace.client.async.ApiClient; -import org.lance.namespace.client.async.ApiException; -import org.lance.namespace.client.async.ApiResponse; -import org.lance.namespace.client.async.Configuration; -import org.lance.namespace.client.async.auth.*; -import org.lance.namespace.client.async.models.*; -import org.lance.namespace.client.async.api.MetadataApi; -import java.util.concurrent.CompletableFuture; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:2333"); - - // Configure OAuth2 access token for authorization: OAuth2 - OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); - OAuth2.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure API key authorization: ApiKeyAuth - ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); - ApiKeyAuth.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //ApiKeyAuth.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: BearerAuth - HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); - BearerAuth.setBearerToken("BEARER TOKEN"); - - MetadataApi apiInstance = new MetadataApi(defaultClient); - String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | - String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - try { - CompletableFuture> response = apiInstance.createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter); - System.out.println("Status code: " + response.get().getStatusCode()); - System.out.println("Response headers: " + response.get().getHeaders()); - System.out.println("Response body: " + response.get().getData()); - } catch (InterruptedException | ExecutionException e) { - ApiException apiException = (ApiException)e.getCause(); - System.err.println("Exception when calling MetadataApi#createEmptyTable"); - System.err.println("Status code: " + apiException.getCode()); - System.err.println("Response headers: " + apiException.getResponseHeaders()); - System.err.println("Reason: " + apiException.getResponseBody()); - e.printStackTrace(); - } catch (ApiException e) { - System.err.println("Exception when calling MetadataApi#createEmptyTable"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - System.err.println("Reason: " + e.getResponseBody()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | -| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | -| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | - -### Return type - -CompletableFuture> - - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Table properties result when creating an empty table | - | -| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -| **404** | A server-side problem that means can not find the specified resource. | - | -| **409** | The request conflicts with the current state of the target resource. | - | -| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - - ## createNamespace > CompletableFuture createNamespace(id, createNamespaceRequest, delimiter) diff --git a/java/lance-namespace-async-client/docs/TableApi.md b/java/lance-namespace-async-client/docs/TableApi.md index 0b3391f65..aea9a2725 100644 --- a/java/lance-namespace-async-client/docs/TableApi.md +++ b/java/lance-namespace-async-client/docs/TableApi.md @@ -20,8 +20,6 @@ All URIs are relative to *http://localhost:2333* | [**batchDeleteTableVersionsWithHttpInfo**](TableApi.md#batchDeleteTableVersionsWithHttpInfo) | **POST** /v1/table/{id}/version/delete | Delete table version records | | [**countTableRows**](TableApi.md#countTableRows) | **POST** /v1/table/{id}/count_rows | Count rows in a table | | [**countTableRowsWithHttpInfo**](TableApi.md#countTableRowsWithHttpInfo) | **POST** /v1/table/{id}/count_rows | Count rows in a table | -| [**createEmptyTable**](TableApi.md#createEmptyTable) | **POST** /v1/table/{id}/create-empty | Create an empty table | -| [**createEmptyTableWithHttpInfo**](TableApi.md#createEmptyTableWithHttpInfo) | **POST** /v1/table/{id}/create-empty | Create an empty table | | [**createTable**](TableApi.md#createTable) | **POST** /v1/table/{id}/create | Create a table with the given name | | [**createTableWithHttpInfo**](TableApi.md#createTableWithHttpInfo) | **POST** /v1/table/{id}/create | Create a table with the given name | | [**createTableIndex**](TableApi.md#createTableIndex) | **POST** /v1/table/{id}/create_index | Create an index on a table | @@ -1629,208 +1627,13 @@ CompletableFuture> | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | -## createEmptyTable - -> CompletableFuture createEmptyTable(id, createEmptyTableRequest, delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Example - -```java -// Import classes: -import org.lance.namespace.client.async.ApiClient; -import org.lance.namespace.client.async.ApiException; -import org.lance.namespace.client.async.Configuration; -import org.lance.namespace.client.async.auth.*; -import org.lance.namespace.client.async.models.*; -import org.lance.namespace.client.async.api.TableApi; -import java.util.concurrent.CompletableFuture; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:2333"); - - // Configure OAuth2 access token for authorization: OAuth2 - OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); - OAuth2.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure API key authorization: ApiKeyAuth - ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); - ApiKeyAuth.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //ApiKeyAuth.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: BearerAuth - HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); - BearerAuth.setBearerToken("BEARER TOKEN"); - - TableApi apiInstance = new TableApi(defaultClient); - String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | - String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - try { - CompletableFuture result = apiInstance.createEmptyTable(id, createEmptyTableRequest, delimiter); - System.out.println(result.get()); - } catch (ApiException e) { - System.err.println("Exception when calling TableApi#createEmptyTable"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | -| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | -| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | - -### Return type - -CompletableFuture<[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md)> - - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Table properties result when creating an empty table | - | -| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -| **404** | A server-side problem that means can not find the specified resource. | - | -| **409** | The request conflicts with the current state of the target resource. | - | -| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - -## createEmptyTableWithHttpInfo - -> CompletableFuture> createEmptyTable createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Example - -```java -// Import classes: -import org.lance.namespace.client.async.ApiClient; -import org.lance.namespace.client.async.ApiException; -import org.lance.namespace.client.async.ApiResponse; -import org.lance.namespace.client.async.Configuration; -import org.lance.namespace.client.async.auth.*; -import org.lance.namespace.client.async.models.*; -import org.lance.namespace.client.async.api.TableApi; -import java.util.concurrent.CompletableFuture; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost:2333"); - - // Configure OAuth2 access token for authorization: OAuth2 - OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2"); - OAuth2.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure API key authorization: ApiKeyAuth - ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); - ApiKeyAuth.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //ApiKeyAuth.setApiKeyPrefix("Token"); - - // Configure HTTP bearer authorization: BearerAuth - HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); - BearerAuth.setBearerToken("BEARER TOKEN"); - - TableApi apiInstance = new TableApi(defaultClient); - String id = "id_example"; // String | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - CreateEmptyTableRequest createEmptyTableRequest = new CreateEmptyTableRequest(); // CreateEmptyTableRequest | - String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - try { - CompletableFuture> response = apiInstance.createEmptyTableWithHttpInfo(id, createEmptyTableRequest, delimiter); - System.out.println("Status code: " + response.get().getStatusCode()); - System.out.println("Response headers: " + response.get().getHeaders()); - System.out.println("Response body: " + response.get().getData()); - } catch (InterruptedException | ExecutionException e) { - ApiException apiException = (ApiException)e.getCause(); - System.err.println("Exception when calling TableApi#createEmptyTable"); - System.err.println("Status code: " + apiException.getCode()); - System.err.println("Response headers: " + apiException.getResponseHeaders()); - System.err.println("Reason: " + apiException.getResponseBody()); - e.printStackTrace(); - } catch (ApiException e) { - System.err.println("Exception when calling TableApi#createEmptyTable"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Response headers: " + e.getResponseHeaders()); - System.err.println("Reason: " + e.getResponseBody()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **id** | **String**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | | -| **createEmptyTableRequest** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | | -| **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | - -### Return type - -CompletableFuture> - - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Table properties result when creating an empty table | - | -| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -| **404** | A server-side problem that means can not find the specified resource. | - | -| **409** | The request conflicts with the current state of the target resource. | - | -| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -| **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - - ## createTable -> CompletableFuture createTable(id, body, delimiter, mode) +> CompletableFuture createTable(id, body, delimiter, mode, properties, storageOptions) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Example @@ -1868,8 +1671,10 @@ public class Example { byte[] body = null; // byte[] | Arrow IPC data String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. String mode = "mode_example"; // String | + String properties = "properties_example"; // String | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + String storageOptions = "storageOptions_example"; // String | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. try { - CompletableFuture result = apiInstance.createTable(id, body, delimiter, mode); + CompletableFuture result = apiInstance.createTable(id, body, delimiter, mode, properties, storageOptions); System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling TableApi#createTable"); @@ -1891,6 +1696,8 @@ public class Example { | **body** | **byte[]**| Arrow IPC data | | | **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | | **mode** | **String**| | [optional] | +| **properties** | **String**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] | +| **storageOptions** | **String**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] | ### Return type @@ -1914,16 +1721,17 @@ CompletableFuture<[**CreateTableResponse**](CreateTableResponse.md)> | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | | **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | ## createTableWithHttpInfo -> CompletableFuture> createTable createTableWithHttpInfo(id, body, delimiter, mode) +> CompletableFuture> createTable createTableWithHttpInfo(id, body, delimiter, mode, properties, storageOptions) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Example @@ -1962,8 +1770,10 @@ public class Example { byte[] body = null; // byte[] | Arrow IPC data String delimiter = "delimiter_example"; // String | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. String mode = "mode_example"; // String | + String properties = "properties_example"; // String | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + String storageOptions = "storageOptions_example"; // String | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. try { - CompletableFuture> response = apiInstance.createTableWithHttpInfo(id, body, delimiter, mode); + CompletableFuture> response = apiInstance.createTableWithHttpInfo(id, body, delimiter, mode, properties, storageOptions); System.out.println("Status code: " + response.get().getStatusCode()); System.out.println("Response headers: " + response.get().getHeaders()); System.out.println("Response body: " + response.get().getData()); @@ -1994,6 +1804,8 @@ public class Example { | **body** | **byte[]**| Arrow IPC data | | | **delimiter** | **String**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] | | **mode** | **String**| | [optional] | +| **properties** | **String**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] | +| **storageOptions** | **String**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] | ### Return type @@ -2017,6 +1829,7 @@ CompletableFuture | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | | **404** | A server-side problem that means can not find the specified resource. | - | +| **409** | The request conflicts with the current state of the target resource. | - | | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java index 614908f63..fd25c51b0 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/DataApi.java @@ -561,7 +561,14 @@ private HttpRequest.Builder countTableRowsRequestBuilder( * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -572,14 +579,29 @@ private HttpRequest.Builder countTableRowsRequestBuilder( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return CompletableFuture<CreateTableResponse> * @throws ApiException if fails to make API call */ public CompletableFuture createTable( - String id, byte[] body, String delimiter, String mode) throws ApiException { + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) + throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = - createTableRequestBuilder(id, body, delimiter, mode); + createTableRequestBuilder(id, body, delimiter, mode, properties, storageOptions); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync( @@ -610,7 +632,14 @@ public CompletableFuture createTable( * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -621,14 +650,29 @@ public CompletableFuture createTable( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return CompletableFuture<ApiResponse<CreateTableResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> createTableWithHttpInfo( - String id, byte[] body, String delimiter, String mode) throws ApiException { + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) + throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = - createTableRequestBuilder(id, body, delimiter, mode); + createTableRequestBuilder(id, body, delimiter, mode, properties, storageOptions); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync( @@ -660,7 +704,13 @@ public CompletableFuture> createTableWithHttpIn } private HttpRequest.Builder createTableRequestBuilder( - String id, byte[] body, String delimiter, String mode) throws ApiException { + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) + throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling createTable"); @@ -682,6 +732,10 @@ private HttpRequest.Builder createTableRequestBuilder( localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); localVarQueryParameterBaseName = "mode"; localVarQueryParams.addAll(ApiClient.parameterToPairs("mode", mode)); + localVarQueryParameterBaseName = "properties"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("properties", properties)); + localVarQueryParameterBaseName = "storage_options"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("storage_options", storageOptions)); if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { StringJoiner queryJoiner = new StringJoiner("&"); diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java index b7ee72047..d14d5fcc9 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/MetadataApi.java @@ -30,8 +30,6 @@ import org.lance.namespace.model.BatchCreateTableVersionsResponse; import org.lance.namespace.model.BatchDeleteTableVersionsRequest; import org.lance.namespace.model.BatchDeleteTableVersionsResponse; -import org.lance.namespace.model.CreateEmptyTableRequest; -import org.lance.namespace.model.CreateEmptyTableResponse; import org.lance.namespace.model.CreateNamespaceRequest; import org.lance.namespace.model.CreateNamespaceResponse; import org.lance.namespace.model.CreateTableIndexRequest; @@ -1064,169 +1062,6 @@ private HttpRequest.Builder batchDeleteTableVersionsRequestBuilder( return localVarRequestBuilder; } - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return CompletableFuture<CreateEmptyTableResponse> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CompletableFuture createEmptyTable( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - try { - HttpRequest.Builder localVarRequestBuilder = - createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); - return memberVarHttpClient - .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) - .thenComposeAsync( - localVarResponse -> { - if (localVarResponse.statusCode() / 100 != 2) { - return CompletableFuture.failedFuture( - getApiException("createEmptyTable", localVarResponse)); - } - try { - String responseBody = localVarResponse.body(); - return CompletableFuture.completedFuture( - responseBody == null || responseBody.isBlank() - ? null - : memberVarObjectMapper.readValue( - responseBody, new TypeReference() {})); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - }); - } catch (ApiException e) { - return CompletableFuture.failedFuture(e); - } - } - - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return CompletableFuture<ApiResponse<CreateEmptyTableResponse>> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CompletableFuture> createEmptyTableWithHttpInfo( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - try { - HttpRequest.Builder localVarRequestBuilder = - createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); - return memberVarHttpClient - .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) - .thenComposeAsync( - localVarResponse -> { - if (memberVarAsyncResponseInterceptor != null) { - memberVarAsyncResponseInterceptor.accept(localVarResponse); - } - if (localVarResponse.statusCode() / 100 != 2) { - return CompletableFuture.failedFuture( - getApiException("createEmptyTable", localVarResponse)); - } - try { - String responseBody = localVarResponse.body(); - return CompletableFuture.completedFuture( - new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody == null || responseBody.isBlank() - ? null - : memberVarObjectMapper.readValue( - responseBody, new TypeReference() {}))); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - }); - } catch (ApiException e) { - return CompletableFuture.failedFuture(e); - } - } - - private HttpRequest.Builder createEmptyTableRequestBuilder( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, "Missing the required parameter 'id' when calling createEmptyTable"); - } - // verify the required parameter 'createEmptyTableRequest' is set - if (createEmptyTableRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'createEmptyTableRequest' when calling createEmptyTable"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = - "/v1/table/{id}/create-empty".replace("{id}", ApiClient.urlEncode(id.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "delimiter"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri( - URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createEmptyTableRequest); - localVarRequestBuilder.method( - "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Create a new namespace Create new namespace `id`. During the creation process, the * implementation may modify user-provided `properties`, such as adding additional diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java index fa9bd8400..c43fea9c7 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/client/async/api/TableApi.java @@ -32,8 +32,6 @@ import org.lance.namespace.model.BatchDeleteTableVersionsRequest; import org.lance.namespace.model.BatchDeleteTableVersionsResponse; import org.lance.namespace.model.CountTableRowsRequest; -import org.lance.namespace.model.CreateEmptyTableRequest; -import org.lance.namespace.model.CreateEmptyTableResponse; import org.lance.namespace.model.CreateTableIndexRequest; import org.lance.namespace.model.CreateTableIndexResponse; import org.lance.namespace.model.CreateTableResponse; @@ -1379,176 +1377,20 @@ private HttpRequest.Builder countTableRowsRequestBuilder( return localVarRequestBuilder; } - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return CompletableFuture<CreateEmptyTableResponse> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CompletableFuture createEmptyTable( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - try { - HttpRequest.Builder localVarRequestBuilder = - createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); - return memberVarHttpClient - .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) - .thenComposeAsync( - localVarResponse -> { - if (localVarResponse.statusCode() / 100 != 2) { - return CompletableFuture.failedFuture( - getApiException("createEmptyTable", localVarResponse)); - } - try { - String responseBody = localVarResponse.body(); - return CompletableFuture.completedFuture( - responseBody == null || responseBody.isBlank() - ? null - : memberVarObjectMapper.readValue( - responseBody, new TypeReference() {})); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - }); - } catch (ApiException e) { - return CompletableFuture.failedFuture(e); - } - } - - /** - * Create an empty table Create an empty table with the given name without touching storage. This - * is a metadata-only operation that records the table existence and sets up aspects like access - * control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file - * in the table directory to mark the table's existence without creating actual Lance data - * files. **Deprecated**: Use `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return CompletableFuture<ApiResponse<CreateEmptyTableResponse>> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public CompletableFuture> createEmptyTableWithHttpInfo( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - try { - HttpRequest.Builder localVarRequestBuilder = - createEmptyTableRequestBuilder(id, createEmptyTableRequest, delimiter); - return memberVarHttpClient - .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) - .thenComposeAsync( - localVarResponse -> { - if (memberVarAsyncResponseInterceptor != null) { - memberVarAsyncResponseInterceptor.accept(localVarResponse); - } - if (localVarResponse.statusCode() / 100 != 2) { - return CompletableFuture.failedFuture( - getApiException("createEmptyTable", localVarResponse)); - } - try { - String responseBody = localVarResponse.body(); - return CompletableFuture.completedFuture( - new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseBody == null || responseBody.isBlank() - ? null - : memberVarObjectMapper.readValue( - responseBody, new TypeReference() {}))); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - }); - } catch (ApiException e) { - return CompletableFuture.failedFuture(e); - } - } - - private HttpRequest.Builder createEmptyTableRequestBuilder( - String id, CreateEmptyTableRequest createEmptyTableRequest, String delimiter) - throws ApiException { - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, "Missing the required parameter 'id' when calling createEmptyTable"); - } - // verify the required parameter 'createEmptyTableRequest' is set - if (createEmptyTableRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'createEmptyTableRequest' when calling createEmptyTable"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = - "/v1/table/{id}/create-empty".replace("{id}", ApiClient.urlEncode(id.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "delimiter"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri( - URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(createEmptyTableRequest); - localVarRequestBuilder.method( - "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Create a table with the given name Create table `id` in the namespace with the given * data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -1559,14 +1401,29 @@ private HttpRequest.Builder createEmptyTableRequestBuilder( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return CompletableFuture<CreateTableResponse> * @throws ApiException if fails to make API call */ public CompletableFuture createTable( - String id, byte[] body, String delimiter, String mode) throws ApiException { + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) + throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = - createTableRequestBuilder(id, body, delimiter, mode); + createTableRequestBuilder(id, body, delimiter, mode, properties, storageOptions); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync( @@ -1597,7 +1454,14 @@ public CompletableFuture createTable( * the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses * Arrow IPC stream as the request body. It passes in the `CreateTableRequest` * information in the following way: - `id`: pass through path parameter of the same - * name - `mode`: pass through query parameter of the same name + * name - `mode`: pass through query parameter of the same name - + * `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -1608,14 +1472,29 @@ public CompletableFuture createTable( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return CompletableFuture<ApiResponse<CreateTableResponse>> * @throws ApiException if fails to make API call */ public CompletableFuture> createTableWithHttpInfo( - String id, byte[] body, String delimiter, String mode) throws ApiException { + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) + throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = - createTableRequestBuilder(id, body, delimiter, mode); + createTableRequestBuilder(id, body, delimiter, mode, properties, storageOptions); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync( @@ -1647,7 +1526,13 @@ public CompletableFuture> createTableWithHttpIn } private HttpRequest.Builder createTableRequestBuilder( - String id, byte[] body, String delimiter, String mode) throws ApiException { + String id, + byte[] body, + String delimiter, + String mode, + String properties, + String storageOptions) + throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling createTable"); @@ -1669,6 +1554,10 @@ private HttpRequest.Builder createTableRequestBuilder( localVarQueryParams.addAll(ApiClient.parameterToPairs("delimiter", delimiter)); localVarQueryParameterBaseName = "mode"; localVarQueryParams.addAll(ApiClient.parameterToPairs("mode", mode)); + localVarQueryParameterBaseName = "properties"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("properties", properties)); + localVarQueryParameterBaseName = "storage_options"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("storage_options", storageOptions)); if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { StringJoiner queryJoiner = new StringJoiner("&"); diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java deleted file mode 100644 index 709e93c5a..000000000 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableRequest.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.lance.namespace.model; - -import org.lance.namespace.client.async.ApiClient; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.StringJoiner; - -/** - * Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - CreateEmptyTableRequest.JSON_PROPERTY_IDENTITY, - CreateEmptyTableRequest.JSON_PROPERTY_CONTEXT, - CreateEmptyTableRequest.JSON_PROPERTY_ID, - CreateEmptyTableRequest.JSON_PROPERTY_LOCATION, - CreateEmptyTableRequest.JSON_PROPERTY_VEND_CREDENTIALS, - CreateEmptyTableRequest.JSON_PROPERTY_PROPERTIES -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class CreateEmptyTableRequest { - public static final String JSON_PROPERTY_IDENTITY = "identity"; - @javax.annotation.Nullable private Identity identity; - - public static final String JSON_PROPERTY_CONTEXT = "context"; - @javax.annotation.Nullable private Map context = new HashMap<>(); - - public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable private List id = new ArrayList<>(); - - public static final String JSON_PROPERTY_LOCATION = "location"; - @javax.annotation.Nullable private String location; - - public static final String JSON_PROPERTY_VEND_CREDENTIALS = "vend_credentials"; - @javax.annotation.Nullable private Boolean vendCredentials; - - public static final String JSON_PROPERTY_PROPERTIES = "properties"; - @javax.annotation.Nullable private Map properties = new HashMap<>(); - - public CreateEmptyTableRequest() {} - - public CreateEmptyTableRequest identity(@javax.annotation.Nullable Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get identity - * - * @return identity - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IDENTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Identity getIdentity() { - return identity; - } - - @JsonProperty(JSON_PROPERTY_IDENTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIdentity(@javax.annotation.Nullable Identity identity) { - this.identity = identity; - } - - public CreateEmptyTableRequest context(@javax.annotation.Nullable Map context) { - this.context = context; - return this; - } - - public CreateEmptyTableRequest putContextItem(String key, String contextItem) { - if (this.context == null) { - this.context = new HashMap<>(); - } - this.context.put(key, contextItem); - return this; - } - - /** - * Arbitrary context for a request as key-value pairs. How to use the context is custom to the - * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using - * the naming convention `x-lance-ctx-<key>: <value>`. For example, a - * context entry `{\"trace_id\": \"abc123\"}` would be sent as the - * header `x-lance-ctx-trace_id: abc123`. - * - * @return context - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CONTEXT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getContext() { - return context; - } - - @JsonProperty(JSON_PROPERTY_CONTEXT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setContext(@javax.annotation.Nullable Map context) { - this.context = context; - } - - public CreateEmptyTableRequest id(@javax.annotation.Nullable List id) { - this.id = id; - return this; - } - - public CreateEmptyTableRequest addIdItem(String idItem) { - if (this.id == null) { - this.id = new ArrayList<>(); - } - this.id.add(idItem); - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable List id) { - this.id = id; - } - - public CreateEmptyTableRequest location(@javax.annotation.Nullable String location) { - this.location = location; - return this; - } - - /** - * Optional storage location for the table. If not provided, the namespace implementation should - * determine the table location. - * - * @return location - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocation() { - return location; - } - - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocation(@javax.annotation.Nullable String location) { - this.location = location; - } - - public CreateEmptyTableRequest vendCredentials( - @javax.annotation.Nullable Boolean vendCredentials) { - this.vendCredentials = vendCredentials; - return this; - } - - /** - * Whether to include vended credentials in the response `storage_options`. When true, - * the implementation should provide vended credentials for accessing storage. When not set, the - * implementation can decide whether to return vended credentials. - * - * @return vendCredentials - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getVendCredentials() { - return vendCredentials; - } - - @JsonProperty(JSON_PROPERTY_VEND_CREDENTIALS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVendCredentials(@javax.annotation.Nullable Boolean vendCredentials) { - this.vendCredentials = vendCredentials; - } - - public CreateEmptyTableRequest properties( - @javax.annotation.Nullable Map properties) { - this.properties = properties; - return this; - } - - public CreateEmptyTableRequest putPropertiesItem(String key, String propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * Properties stored on the table, if supported by the server. - * - * @return properties - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getProperties() { - return properties; - } - - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperties(@javax.annotation.Nullable Map properties) { - this.properties = properties; - } - - /** Return true if this CreateEmptyTableRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEmptyTableRequest createEmptyTableRequest = (CreateEmptyTableRequest) o; - return Objects.equals(this.identity, createEmptyTableRequest.identity) - && Objects.equals(this.context, createEmptyTableRequest.context) - && Objects.equals(this.id, createEmptyTableRequest.id) - && Objects.equals(this.location, createEmptyTableRequest.location) - && Objects.equals(this.vendCredentials, createEmptyTableRequest.vendCredentials) - && Objects.equals(this.properties, createEmptyTableRequest.properties); - } - - @Override - public int hashCode() { - return Objects.hash(identity, context, id, location, vendCredentials, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEmptyTableRequest {\n"); - sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" vendCredentials: ").append(toIndentedString(vendCredentials)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `identity` to the URL query string - if (getIdentity() != null) { - joiner.add(getIdentity().toUrlQueryString(prefix + "identity" + suffix)); - } - - // add `context` to the URL query string - if (getContext() != null) { - for (String _key : getContext().keySet()) { - joiner.add( - String.format( - "%scontext%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getContext().get(_key), - ApiClient.urlEncode(ApiClient.valueToString(getContext().get(_key))))); - } - } - - // add `id` to the URL query string - if (getId() != null) { - for (int i = 0; i < getId().size(); i++) { - joiner.add( - String.format( - "%sid%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, i, containerSuffix), - ApiClient.urlEncode(ApiClient.valueToString(getId().get(i))))); - } - } - - // add `location` to the URL query string - if (getLocation() != null) { - joiner.add( - String.format( - "%slocation%s=%s", - prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); - } - - // add `vend_credentials` to the URL query string - if (getVendCredentials() != null) { - joiner.add( - String.format( - "%svend_credentials%s=%s", - prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVendCredentials())))); - } - - // add `properties` to the URL query string - if (getProperties() != null) { - for (String _key : getProperties().keySet()) { - joiner.add( - String.format( - "%sproperties%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getProperties().get(_key), - ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); - } - } - - return joiner.toString(); - } -} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java deleted file mode 100644 index 5df104cf9..000000000 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateEmptyTableResponse.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.lance.namespace.model; - -import org.lance.namespace.client.async.ApiClient; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.StringJoiner; - -/** - * Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` - * instead. - * - * @deprecated - */ -@Deprecated -@JsonPropertyOrder({ - CreateEmptyTableResponse.JSON_PROPERTY_TRANSACTION_ID, - CreateEmptyTableResponse.JSON_PROPERTY_LOCATION, - CreateEmptyTableResponse.JSON_PROPERTY_STORAGE_OPTIONS, - CreateEmptyTableResponse.JSON_PROPERTY_PROPERTIES -}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class CreateEmptyTableResponse { - public static final String JSON_PROPERTY_TRANSACTION_ID = "transaction_id"; - @javax.annotation.Nullable private String transactionId; - - public static final String JSON_PROPERTY_LOCATION = "location"; - @javax.annotation.Nullable private String location; - - public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; - @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); - - public static final String JSON_PROPERTY_PROPERTIES = "properties"; - @javax.annotation.Nullable private Map properties = new HashMap<>(); - - public CreateEmptyTableResponse() {} - - public CreateEmptyTableResponse transactionId(@javax.annotation.Nullable String transactionId) { - this.transactionId = transactionId; - return this; - } - - /** - * Optional transaction identifier - * - * @return transactionId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTransactionId() { - return transactionId; - } - - @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTransactionId(@javax.annotation.Nullable String transactionId) { - this.transactionId = transactionId; - } - - public CreateEmptyTableResponse location(@javax.annotation.Nullable String location) { - this.location = location; - return this; - } - - /** - * Get location - * - * @return location - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocation() { - return location; - } - - @JsonProperty(JSON_PROPERTY_LOCATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocation(@javax.annotation.Nullable String location) { - this.location = location; - } - - public CreateEmptyTableResponse storageOptions( - @javax.annotation.Nullable Map storageOptions) { - this.storageOptions = storageOptions; - return this; - } - - public CreateEmptyTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { - if (this.storageOptions == null) { - this.storageOptions = new HashMap<>(); - } - this.storageOptions.put(key, storageOptionsItem); - return this; - } - - /** - * Configuration options to be used to access storage. The available options depend on the type of - * storage in use. These will be passed directly to Lance to initialize storage access. - * - * @return storageOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getStorageOptions() { - return storageOptions; - } - - @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { - this.storageOptions = storageOptions; - } - - public CreateEmptyTableResponse properties( - @javax.annotation.Nullable Map properties) { - this.properties = properties; - return this; - } - - public CreateEmptyTableResponse putPropertiesItem(String key, String propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * If the implementation does not support table properties, it should return null for this field. - * Otherwise it should return the properties. - * - * @return properties - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getProperties() { - return properties; - } - - @JsonProperty(JSON_PROPERTY_PROPERTIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperties(@javax.annotation.Nullable Map properties) { - this.properties = properties; - } - - /** Return true if this CreateEmptyTableResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEmptyTableResponse createEmptyTableResponse = (CreateEmptyTableResponse) o; - return Objects.equals(this.transactionId, createEmptyTableResponse.transactionId) - && Objects.equals(this.location, createEmptyTableResponse.location) - && Objects.equals(this.storageOptions, createEmptyTableResponse.storageOptions) - && Objects.equals(this.properties, createEmptyTableResponse.properties); - } - - @Override - public int hashCode() { - return Objects.hash(transactionId, location, storageOptions, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEmptyTableResponse {\n"); - sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `transaction_id` to the URL query string - if (getTransactionId() != null) { - joiner.add( - String.format( - "%stransaction_id%s=%s", - prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTransactionId())))); - } - - // add `location` to the URL query string - if (getLocation() != null) { - joiner.add( - String.format( - "%slocation%s=%s", - prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLocation())))); - } - - // add `storage_options` to the URL query string - if (getStorageOptions() != null) { - for (String _key : getStorageOptions().keySet()) { - joiner.add( - String.format( - "%sstorage_options%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getStorageOptions().get(_key), - ApiClient.urlEncode(ApiClient.valueToString(getStorageOptions().get(_key))))); - } - } - - // add `properties` to the URL query string - if (getProperties() != null) { - for (String _key : getProperties().keySet()) { - joiner.add( - String.format( - "%sproperties%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getProperties().get(_key), - ApiClient.urlEncode(ApiClient.valueToString(getProperties().get(_key))))); - } - } - - return joiner.toString(); - } -} diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java index 1ac36e1c5..1e4010d2b 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableRequest.java @@ -26,13 +26,18 @@ import java.util.Objects; import java.util.StringJoiner; -/** Request for creating a table, excluding the Arrow IPC stream. */ +/** + * Request for creating a table, excluding the Arrow IPC stream. The table location and any + * credential vending behavior are determined by the implementation and returned in the response, + * rather than specified in this request. + */ @JsonPropertyOrder({ CreateTableRequest.JSON_PROPERTY_IDENTITY, CreateTableRequest.JSON_PROPERTY_CONTEXT, CreateTableRequest.JSON_PROPERTY_ID, CreateTableRequest.JSON_PROPERTY_MODE, - CreateTableRequest.JSON_PROPERTY_PROPERTIES + CreateTableRequest.JSON_PROPERTY_PROPERTIES, + CreateTableRequest.JSON_PROPERTY_STORAGE_OPTIONS }) @javax.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", @@ -53,6 +58,9 @@ public class CreateTableRequest { public static final String JSON_PROPERTY_PROPERTIES = "properties"; @javax.annotation.Nullable private Map properties = new HashMap<>(); + public static final String JSON_PROPERTY_STORAGE_OPTIONS = "storage_options"; + @javax.annotation.Nullable private Map storageOptions = new HashMap<>(); + public CreateTableRequest() {} public CreateTableRequest identity(@javax.annotation.Nullable Identity identity) { @@ -185,7 +193,8 @@ public CreateTableRequest putPropertiesItem(String key, String propertiesItem) { } /** - * Properties stored on the table, if supported by the implementation. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context, if supported by the implementation. * * @return properties */ @@ -202,6 +211,39 @@ public void setProperties(@javax.annotation.Nullable Map propert this.properties = properties; } + public CreateTableRequest storageOptions( + @javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + return this; + } + + public CreateTableRequest putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Storage options that configure overrides for writing table data and metadata during table + * creation. These are passed to Lance for the write path. + * + * @return storageOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getStorageOptions() { + return storageOptions; + } + + @JsonProperty(JSON_PROPERTY_STORAGE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageOptions(@javax.annotation.Nullable Map storageOptions) { + this.storageOptions = storageOptions; + } + /** Return true if this CreateTableRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -216,12 +258,13 @@ public boolean equals(Object o) { && Objects.equals(this.context, createTableRequest.context) && Objects.equals(this.id, createTableRequest.id) && Objects.equals(this.mode, createTableRequest.mode) - && Objects.equals(this.properties, createTableRequest.properties); + && Objects.equals(this.properties, createTableRequest.properties) + && Objects.equals(this.storageOptions, createTableRequest.storageOptions); } @Override public int hashCode() { - return Objects.hash(identity, context, id, mode, properties); + return Objects.hash(identity, context, id, mode, properties, storageOptions); } @Override @@ -233,6 +276,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); sb.append("}"); return sb.toString(); } @@ -339,6 +383,22 @@ public String toUrlQueryString(String prefix) { } } + // add `storage_options` to the URL query string + if (getStorageOptions() != null) { + for (String _key : getStorageOptions().keySet()) { + joiner.add( + String.format( + "%sstorage_options%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getStorageOptions().get(_key), + ApiClient.urlEncode(ApiClient.valueToString(getStorageOptions().get(_key))))); + } + } + return joiner.toString(); } } diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java index 8c14aee11..867af878e 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/CreateTableResponse.java @@ -169,8 +169,9 @@ public CreateTableResponse putPropertiesItem(String key, String propertiesItem) } /** - * If the implementation does not support table properties, it should return null for this field. - * Otherwise it should return the properties. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context. If the implementation does not support table properties, it should return null for + * this field. * * @return properties */ diff --git a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java index 85cc627e6..f6610ad7a 100644 --- a/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java +++ b/java/lance-namespace-async-client/src/main/java/org/lance/namespace/model/DeclareTableRequest.java @@ -211,7 +211,8 @@ public DeclareTableRequest putPropertiesItem(String key, String propertiesItem) } /** - * Properties stored on the table, if supported by the server. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context, if supported by the implementation. * * @return properties */ diff --git a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java index 163846d96..193901b4b 100644 --- a/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java +++ b/java/lance-namespace-core-async/src/main/java/org/lance/namespace/async/LanceNamespaceAsync.java @@ -355,20 +355,6 @@ default CompletableFuture declareTable(DeclareTableRequest new UnsupportedOperationException("Not supported: declareTable")); } - /** - * Create an empty table (metadata only operation). - * - * @param request The create empty table request - * @return A CompletableFuture containing the create empty table response - * @deprecated Use {@link #declareTable(DeclareTableRequest)} instead. - */ - @Deprecated - default CompletableFuture createEmptyTable( - CreateEmptyTableRequest request) { - return CompletableFuture.failedFuture( - new UnsupportedOperationException("Not supported: createEmptyTable")); - } - /** * Insert data into a table. * diff --git a/java/lance-namespace-core/src/main/java/org/lance/namespace/LanceNamespace.java b/java/lance-namespace-core/src/main/java/org/lance/namespace/LanceNamespace.java index ec8c4454c..cd3084796 100644 --- a/java/lance-namespace-core/src/main/java/org/lance/namespace/LanceNamespace.java +++ b/java/lance-namespace-core/src/main/java/org/lance/namespace/LanceNamespace.java @@ -337,18 +337,6 @@ default DeclareTableResponse declareTable(DeclareTableRequest request) { throw new UnsupportedOperationException("Not supported: declareTable"); } - /** - * Create an empty table (metadata only operation). - * - * @param request The create empty table request - * @return The create empty table response - * @deprecated Use {@link #declareTable(DeclareTableRequest)} instead. - */ - @Deprecated - default CreateEmptyTableResponse createEmptyTable(CreateEmptyTableRequest request) { - throw new UnsupportedOperationException("Not supported: createEmptyTable"); - } - /** * Insert data into a table. * diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java index 1d14c831b..0d3ecd26c 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/api/TableApi.java @@ -27,8 +27,6 @@ import org.lance.namespace.server.springboot.model.BatchDeleteTableVersionsRequest; import org.lance.namespace.server.springboot.model.BatchDeleteTableVersionsResponse; import org.lance.namespace.server.springboot.model.CountTableRowsRequest; -import org.lance.namespace.server.springboot.model.CreateEmptyTableRequest; -import org.lance.namespace.server.springboot.model.CreateEmptyTableResponse; import org.lance.namespace.server.springboot.model.CreateTableIndexRequest; import org.lance.namespace.server.springboot.model.CreateTableIndexResponse; import org.lance.namespace.server.springboot.model.CreateTableResponse; @@ -1520,203 +1518,6 @@ default ResponseEntity countTableRows( return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } - /** - * POST /v1/table/{id}/create-empty : Create an empty table Create an empty table with the given - * name without touching storage. This is a metadata-only operation that records the table - * existence and sets up aspects like access control. For DirectoryNamespace implementation, this - * creates a `.lance-reserved` file in the table directory to mark the table's - * existence without creating actual Lance data files. **Deprecated**: Use - * `DeclareTable` instead. - * - * @param id `string identifier` of an object in a namespace, following the Lance - * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. - * For example, `v1/namespace/$/list` performs a `ListNamespace` on the - * root namespace. (required) - * @param createEmptyTableRequest (required) - * @param delimiter An optional delimiter of the `string identifier`, following the - * Lance Namespace spec. When not specified, the `$` delimiter must be used. - * (optional) - * @return Table properties result when creating an empty table (status code 200) or Indicates a - * bad request error. It could be caused by an unexpected request body format or other forms - * of request validation failure, such as invalid json. Usually serves application/json - * content, although in some cases simple text/plain content might be returned by the - * server's middleware. (status code 400) or Unauthorized. The request lacks valid - * authentication credentials for the operation. (status code 401) or Forbidden. Authenticated - * user does not have the necessary permissions. (status code 403) or A server-side problem - * that means can not find the specified resource. (status code 404) or The request conflicts - * with the current state of the target resource. (status code 409) or The service is not - * ready to handle the request. The client should wait and retry. The service may additionally - * send a Retry-After header to indicate when to retry. (status code 503) or A server-side - * problem that might not be addressable from the client side. Used for server 5xx errors - * without more specific documentation in individual routes. (status code 5XX) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "createEmptyTable", - summary = "Create an empty table", - description = - "Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. ", - deprecated = true, - tags = {"Table", "Metadata"}, - responses = { - @ApiResponse( - responseCode = "200", - description = "Table properties result when creating an empty table", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = CreateEmptyTableResponse.class)) - }), - @ApiResponse( - responseCode = "400", - description = - "Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }), - @ApiResponse( - responseCode = "401", - description = - "Unauthorized. The request lacks valid authentication credentials for the operation.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }), - @ApiResponse( - responseCode = "403", - description = "Forbidden. Authenticated user does not have the necessary permissions.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }), - @ApiResponse( - responseCode = "404", - description = "A server-side problem that means can not find the specified resource.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }), - @ApiResponse( - responseCode = "409", - description = "The request conflicts with the current state of the target resource.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }), - @ApiResponse( - responseCode = "503", - description = - "The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }), - @ApiResponse( - responseCode = "5XX", - description = - "A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes.", - content = { - @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "OAuth2"), - @SecurityRequirement(name = "ApiKeyAuth"), - @SecurityRequirement(name = "BearerAuth") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/v1/table/{id}/create-empty", - produces = {"application/json"}, - consumes = {"application/json"}) - default ResponseEntity createEmptyTable( - @Parameter( - name = "id", - description = - "`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ", - required = true, - in = ParameterIn.PATH) - @PathVariable("id") - String id, - @Parameter(name = "CreateEmptyTableRequest", description = "", required = true) - @Valid - @RequestBody - CreateEmptyTableRequest createEmptyTableRequest, - @Parameter( - name = "delimiter", - description = - "An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ", - in = ParameterIn.QUERY) - @Valid - @RequestParam(value = "delimiter", required = false) - Optional delimiter) { - getRequest() - .ifPresent( - request -> { - for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"transaction_id\" : \"transaction_id\", \"location\" : \"location\", \"properties\" : { \"owner\" : \"Ralph\", \"created_at\" : \"1452120468\" }, \"storage_options\" : { \"key\" : \"storage_options\" } }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = - "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - } - /** * POST /v1/table/{id}/create : Create a table with the given name Create table `id` in * the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is @@ -1724,7 +1525,13 @@ default ResponseEntity createEmptyTable( * NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the * `CreateTableRequest` information in the following way: - `id`: pass through * path parameter of the same name - `mode`: pass through query parameter of the same - * name + * name - `properties`: serialize as a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`; + * these are business logic properties managed by the namespace implementation outside Lance + * context - `storage_options`: serialize as a single JSON-encoded query parameter such + * as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; + * these configure write-time overrides for data and metadata written during table creation * * @param id `string identifier` of an object in a namespace, following the Lance * Namespace spec. When the value is equal to the delimiter, it represents the root namespace. @@ -1735,6 +1542,15 @@ default ResponseEntity createEmptyTable( * Lance Namespace spec. When not specified, the `$` delimiter must be used. * (optional) * @param mode (optional) + * @param properties Business logic properties managed by the namespace implementation outside + * Lance context. The map is translated to a single JSON-encoded query parameter such as + * `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + * (optional) + * @param storageOptions Storage options that configure overrides for writing table data and + * metadata during table creation. These are passed to Lance for the write path. The map is + * translated to a single JSON-encoded query parameter such as + * `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + * (optional) * @return Table properties result when creating a table (status code 200) or Indicates a bad * request error. It could be caused by an unexpected request body format or other forms of * request validation failure, such as invalid json. Usually serves application/json content, @@ -1742,8 +1558,9 @@ default ResponseEntity createEmptyTable( * middleware. (status code 400) or Unauthorized. The request lacks valid authentication * credentials for the operation. (status code 401) or Forbidden. Authenticated user does not * have the necessary permissions. (status code 403) or A server-side problem that means can - * not find the specified resource. (status code 404) or The service is not ready to handle - * the request. The client should wait and retry. The service may additionally send a + * not find the specified resource. (status code 404) or The request conflicts with the + * current state of the target resource. (status code 409) or The service is not ready to + * handle the request. The client should wait and retry. The service may additionally send a * Retry-After header to indicate when to retry. (status code 503) or A server-side problem * that might not be addressable from the client side. Used for server 5xx errors without more * specific documentation in individual routes. (status code 5XX) @@ -1752,7 +1569,7 @@ default ResponseEntity createEmptyTable( operationId = "createTable", summary = "Create a table with the given name", description = - "Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name ", + "Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ", tags = {"Table", "Data"}, responses = { @ApiResponse( @@ -1797,6 +1614,14 @@ default ResponseEntity createEmptyTable( mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class)) }), + @ApiResponse( + responseCode = "409", + description = "The request conflicts with the current state of the target resource.", + content = { + @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)) + }), @ApiResponse( responseCode = "503", description = @@ -1848,7 +1673,23 @@ default ResponseEntity createTable( @Parameter(name = "mode", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "mode", required = false) - Optional mode) { + Optional mode, + @Parameter( + name = "properties", + description = + "Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ", + in = ParameterIn.QUERY) + @Valid + @RequestParam(value = "properties", required = false) + Optional properties, + @Parameter( + name = "storage_options", + description = + "Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ", + in = ParameterIn.QUERY) + @Valid + @RequestParam(value = "storage_options", required = false) + Optional storageOptions) { getRequest() .ifPresent( request -> { @@ -1895,6 +1736,12 @@ default ResponseEntity createTable( ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = + "{ \"code\" : 4, \"instance\" : \"/v1/table/production$users/describe\", \"detail\" : \"The table may have been dropped or renamed\", \"error\" : \"Table 'users' not found in namespace 'production'\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } } }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableRequest.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableRequest.java deleted file mode 100644 index cedbd31ce..000000000 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableRequest.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.lance.namespace.server.springboot.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.annotation.Generated; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; - -import java.util.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - * - * @deprecated - */ -@Deprecated -@Schema( - name = "CreateEmptyTableRequest", - description = - "Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. ") -@Generated( - value = "org.openapitools.codegen.languages.SpringCodegen", - comments = "Generator version: 7.12.0") -public class CreateEmptyTableRequest { - - private Identity identity; - - @Valid private Map context = new HashMap<>(); - - @Valid private List id = new ArrayList<>(); - - private String location; - - private Boolean vendCredentials; - - @Valid private Map properties = new HashMap<>(); - - public CreateEmptyTableRequest identity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get identity - * - * @return identity - */ - @Valid - @Schema(name = "identity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("identity") - public Identity getIdentity() { - return identity; - } - - public void setIdentity(Identity identity) { - this.identity = identity; - } - - public CreateEmptyTableRequest context(Map context) { - this.context = context; - return this; - } - - public CreateEmptyTableRequest putContextItem(String key, String contextItem) { - if (this.context == null) { - this.context = new HashMap<>(); - } - this.context.put(key, contextItem); - return this; - } - - /** - * Arbitrary context for a request as key-value pairs. How to use the context is custom to the - * specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using - * the naming convention `x-lance-ctx-: `. For example, a context entry - * `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. - * - * @return context - */ - @Schema( - name = "context", - description = - "Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-: `. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. ", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("context") - public Map getContext() { - return context; - } - - public void setContext(Map context) { - this.context = context; - } - - public CreateEmptyTableRequest id(List id) { - this.id = id; - return this; - } - - public CreateEmptyTableRequest addIdItem(String idItem) { - if (this.id == null) { - this.id = new ArrayList<>(); - } - this.id.add(idItem); - return this; - } - - /** - * Get id - * - * @return id - */ - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("id") - public List getId() { - return id; - } - - public void setId(List id) { - this.id = id; - } - - public CreateEmptyTableRequest location(String location) { - this.location = location; - return this; - } - - /** - * Optional storage location for the table. If not provided, the namespace implementation should - * determine the table location. - * - * @return location - */ - @Schema( - name = "location", - description = - "Optional storage location for the table. If not provided, the namespace implementation should determine the table location. ", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("location") - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public CreateEmptyTableRequest vendCredentials(Boolean vendCredentials) { - this.vendCredentials = vendCredentials; - return this; - } - - /** - * Whether to include vended credentials in the response `storage_options`. When true, the - * implementation should provide vended credentials for accessing storage. When not set, the - * implementation can decide whether to return vended credentials. - * - * @return vendCredentials - */ - @Schema( - name = "vend_credentials", - description = - "Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. ", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("vend_credentials") - public Boolean getVendCredentials() { - return vendCredentials; - } - - public void setVendCredentials(Boolean vendCredentials) { - this.vendCredentials = vendCredentials; - } - - public CreateEmptyTableRequest properties(Map properties) { - this.properties = properties; - return this; - } - - public CreateEmptyTableRequest putPropertiesItem(String key, String propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * Properties stored on the table, if supported by the server. - * - * @return properties - */ - @Schema( - name = "properties", - description = "Properties stored on the table, if supported by the server. ", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public Map getProperties() { - return properties; - } - - public void setProperties(Map properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEmptyTableRequest createEmptyTableRequest = (CreateEmptyTableRequest) o; - return Objects.equals(this.identity, createEmptyTableRequest.identity) - && Objects.equals(this.context, createEmptyTableRequest.context) - && Objects.equals(this.id, createEmptyTableRequest.id) - && Objects.equals(this.location, createEmptyTableRequest.location) - && Objects.equals(this.vendCredentials, createEmptyTableRequest.vendCredentials) - && Objects.equals(this.properties, createEmptyTableRequest.properties); - } - - @Override - public int hashCode() { - return Objects.hash(identity, context, id, location, vendCredentials, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEmptyTableRequest {\n"); - sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); - sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" vendCredentials: ").append(toIndentedString(vendCredentials)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableResponse.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableResponse.java deleted file mode 100644 index d314bdb6b..000000000 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateEmptyTableResponse.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.lance.namespace.server.springboot.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.annotation.Generated; -import jakarta.validation.Valid; -import jakarta.validation.constraints.*; - -import java.util.*; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` - * instead. - * - * @deprecated - */ -@Deprecated -@Schema( - name = "CreateEmptyTableResponse", - description = - "Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. ") -@Generated( - value = "org.openapitools.codegen.languages.SpringCodegen", - comments = "Generator version: 7.12.0") -public class CreateEmptyTableResponse { - - private String transactionId; - - private String location; - - @Valid private Map storageOptions = new HashMap<>(); - - @Valid private Map properties = new HashMap<>(); - - public CreateEmptyTableResponse transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - - /** - * Optional transaction identifier - * - * @return transactionId - */ - @Schema( - name = "transaction_id", - description = "Optional transaction identifier", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("transaction_id") - public String getTransactionId() { - return transactionId; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } - - public CreateEmptyTableResponse location(String location) { - this.location = location; - return this; - } - - /** - * Get location - * - * @return location - */ - @Schema(name = "location", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("location") - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public CreateEmptyTableResponse storageOptions(Map storageOptions) { - this.storageOptions = storageOptions; - return this; - } - - public CreateEmptyTableResponse putStorageOptionsItem(String key, String storageOptionsItem) { - if (this.storageOptions == null) { - this.storageOptions = new HashMap<>(); - } - this.storageOptions.put(key, storageOptionsItem); - return this; - } - - /** - * Configuration options to be used to access storage. The available options depend on the type of - * storage in use. These will be passed directly to Lance to initialize storage access. - * - * @return storageOptions - */ - @Schema( - name = "storage_options", - description = - "Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. ", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("storage_options") - public Map getStorageOptions() { - return storageOptions; - } - - public void setStorageOptions(Map storageOptions) { - this.storageOptions = storageOptions; - } - - public CreateEmptyTableResponse properties(Map properties) { - this.properties = properties; - return this; - } - - public CreateEmptyTableResponse putPropertiesItem(String key, String propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * If the implementation does not support table properties, it should return null for this field. - * Otherwise it should return the properties. - * - * @return properties - */ - @Schema( - name = "properties", - example = "{owner=Ralph, created_at=1452120468}", - description = - "If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. ", - requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("properties") - public Map getProperties() { - return properties; - } - - public void setProperties(Map properties) { - this.properties = properties; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateEmptyTableResponse createEmptyTableResponse = (CreateEmptyTableResponse) o; - return Objects.equals(this.transactionId, createEmptyTableResponse.transactionId) - && Objects.equals(this.location, createEmptyTableResponse.location) - && Objects.equals(this.storageOptions, createEmptyTableResponse.storageOptions) - && Objects.equals(this.properties, createEmptyTableResponse.properties); - } - - @Override - public int hashCode() { - return Objects.hash(transactionId, location, storageOptions, properties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEmptyTableResponse {\n"); - sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); - sb.append(" location: ").append(toIndentedString(location)).append("\n"); - sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableRequest.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableRequest.java index b8bd4000b..008612742 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableRequest.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableRequest.java @@ -26,10 +26,15 @@ import java.util.Map; import java.util.Objects; -/** Request for creating a table, excluding the Arrow IPC stream. */ +/** + * Request for creating a table, excluding the Arrow IPC stream. The table location and any + * credential vending behavior are determined by the implementation and returned in the response, + * rather than specified in this request. + */ @Schema( name = "CreateTableRequest", - description = "Request for creating a table, excluding the Arrow IPC stream. ") + description = + "Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. ") @Generated( value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.12.0") @@ -45,6 +50,8 @@ public class CreateTableRequest { @Valid private Map properties = new HashMap<>(); + @Valid private Map storageOptions = new HashMap<>(); + public CreateTableRequest identity(Identity identity) { this.identity = identity; return this; @@ -171,13 +178,15 @@ public CreateTableRequest putPropertiesItem(String key, String propertiesItem) { } /** - * Properties stored on the table, if supported by the implementation. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context, if supported by the implementation. * * @return properties */ @Schema( name = "properties", - description = "Properties stored on the table, if supported by the implementation. ", + description = + "Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("properties") public Map getProperties() { @@ -188,6 +197,39 @@ public void setProperties(Map properties) { this.properties = properties; } + public CreateTableRequest storageOptions(Map storageOptions) { + this.storageOptions = storageOptions; + return this; + } + + public CreateTableRequest putStorageOptionsItem(String key, String storageOptionsItem) { + if (this.storageOptions == null) { + this.storageOptions = new HashMap<>(); + } + this.storageOptions.put(key, storageOptionsItem); + return this; + } + + /** + * Storage options that configure overrides for writing table data and metadata during table + * creation. These are passed to Lance for the write path. + * + * @return storageOptions + */ + @Schema( + name = "storage_options", + description = + "Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. ", + requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("storage_options") + public Map getStorageOptions() { + return storageOptions; + } + + public void setStorageOptions(Map storageOptions) { + this.storageOptions = storageOptions; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -201,12 +243,13 @@ public boolean equals(Object o) { && Objects.equals(this.context, createTableRequest.context) && Objects.equals(this.id, createTableRequest.id) && Objects.equals(this.mode, createTableRequest.mode) - && Objects.equals(this.properties, createTableRequest.properties); + && Objects.equals(this.properties, createTableRequest.properties) + && Objects.equals(this.storageOptions, createTableRequest.storageOptions); } @Override public int hashCode() { - return Objects.hash(identity, context, id, mode, properties); + return Objects.hash(identity, context, id, mode, properties, storageOptions); } @Override @@ -218,6 +261,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" storageOptions: ").append(toIndentedString(storageOptions)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableResponse.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableResponse.java index 4ccb4a61c..42a9e0461 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableResponse.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/CreateTableResponse.java @@ -151,8 +151,9 @@ public CreateTableResponse putPropertiesItem(String key, String propertiesItem) } /** - * If the implementation does not support table properties, it should return null for this field. - * Otherwise it should return the properties. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context. If the implementation does not support table properties, it should return null for + * this field. * * @return properties */ @@ -160,7 +161,7 @@ public CreateTableResponse putPropertiesItem(String key, String propertiesItem) name = "properties", example = "{owner=Ralph, created_at=1452120468}", description = - "If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. ", + "Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("properties") public Map getProperties() { diff --git a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/DeclareTableRequest.java b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/DeclareTableRequest.java index a4ccdb4c5..1818ca1da 100644 --- a/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/DeclareTableRequest.java +++ b/java/lance-namespace-springboot-server/src/main/java/org/lance/namespace/server/springboot/model/DeclareTableRequest.java @@ -194,13 +194,15 @@ public DeclareTableRequest putPropertiesItem(String key, String propertiesItem) } /** - * Properties stored on the table, if supported by the server. + * Business logic properties stored and managed by the namespace implementation outside Lance + * context, if supported by the implementation. * * @return properties */ @Schema( name = "properties", - description = "Properties stored on the table, if supported by the server. ", + description = + "Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("properties") public Map getProperties() { diff --git a/python/lance_namespace/lance_namespace/__init__.py b/python/lance_namespace/lance_namespace/__init__.py index 3fb9c38c4..854a1bbaa 100644 --- a/python/lance_namespace/lance_namespace/__init__.py +++ b/python/lance_namespace/lance_namespace/__init__.py @@ -25,7 +25,6 @@ """ import importlib -import warnings from abc import ABC, abstractmethod from typing import Dict @@ -77,8 +76,6 @@ CommitTableResult, CountTableRowsRequest, CreateTableVersionEntry, - CreateEmptyTableRequest, - CreateEmptyTableResponse, CreateNamespaceRequest, CreateNamespaceResponse, CreateTableIndexRequest, @@ -204,8 +201,6 @@ "CommitTableResult", "CountTableRowsRequest", "CreateTableVersionEntry", - "CreateEmptyTableRequest", - "CreateEmptyTableResponse", "CreateNamespaceRequest", "CreateNamespaceResponse", "CreateTableIndexRequest", @@ -506,30 +501,6 @@ def declare_table( """ raise UnsupportedOperationError("Not supported: declare_table") - def create_empty_table( - self, request: CreateEmptyTableRequest - ) -> CreateEmptyTableResponse: - """Create an empty table (metadata only operation). - - .. deprecated:: - Use :meth:`declare_table` instead. - - Raises - ------ - NamespaceNotFoundError - If the namespace does not exist. - TableAlreadyExistsError - If a table with the same name already exists. - ConcurrentModificationError - If a concurrent modification conflict occurs. - """ - warnings.warn( - "create_empty_table is deprecated, use declare_table instead", - DeprecationWarning, - stacklevel=2, - ) - raise UnsupportedOperationError("Not supported: create_empty_table") - def insert_into_table( self, request: InsertIntoTableRequest, request_data: bytes ) -> InsertIntoTableResponse: diff --git a/python/lance_namespace_urllib3_client/README.md b/python/lance_namespace_urllib3_client/README.md index 43aaeaa4f..c6fef442b 100644 --- a/python/lance_namespace_urllib3_client/README.md +++ b/python/lance_namespace_urllib3_client/README.md @@ -134,7 +134,6 @@ Class | Method | HTTP request | Description *MetadataApi* | [**batch_commit_tables**](docs/MetadataApi.md#batch_commit_tables) | **POST** /v1/table/batch-commit | Atomically commit a batch of mixed table operations *MetadataApi* | [**batch_create_table_versions**](docs/MetadataApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *MetadataApi* | [**batch_delete_table_versions**](docs/MetadataApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records -*MetadataApi* | [**create_empty_table**](docs/MetadataApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table *MetadataApi* | [**create_namespace**](docs/MetadataApi.md#create_namespace) | **POST** /v1/namespace/{id}/create | Create a new namespace *MetadataApi* | [**create_table_index**](docs/MetadataApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table *MetadataApi* | [**create_table_scalar_index**](docs/MetadataApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -179,7 +178,6 @@ Class | Method | HTTP request | Description *TableApi* | [**batch_create_table_versions**](docs/TableApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *TableApi* | [**batch_delete_table_versions**](docs/TableApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records *TableApi* | [**count_table_rows**](docs/TableApi.md#count_table_rows) | **POST** /v1/table/{id}/count_rows | Count rows in a table -*TableApi* | [**create_empty_table**](docs/TableApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table *TableApi* | [**create_table**](docs/TableApi.md#create_table) | **POST** /v1/table/{id}/create | Create a table with the given name *TableApi* | [**create_table_index**](docs/TableApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table *TableApi* | [**create_table_scalar_index**](docs/TableApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -252,8 +250,6 @@ Class | Method | HTTP request | Description - [CommitTableOperation](docs/CommitTableOperation.md) - [CommitTableResult](docs/CommitTableResult.md) - [CountTableRowsRequest](docs/CountTableRowsRequest.md) - - [CreateEmptyTableRequest](docs/CreateEmptyTableRequest.md) - - [CreateEmptyTableResponse](docs/CreateEmptyTableResponse.md) - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [CreateTableIndexRequest](docs/CreateTableIndexRequest.md) diff --git a/python/lance_namespace_urllib3_client/docs/CreateEmptyTableRequest.md b/python/lance_namespace_urllib3_client/docs/CreateEmptyTableRequest.md deleted file mode 100644 index eb7fc6ca2..000000000 --- a/python/lance_namespace_urllib3_client/docs/CreateEmptyTableRequest.md +++ /dev/null @@ -1,35 +0,0 @@ -# CreateEmptyTableRequest - -Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | [**Identity**](Identity.md) | | [optional] -**context** | **Dict[str, str]** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] -**id** | **List[str]** | | [optional] -**location** | **str** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] -**vend_credentials** | **bool** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] -**properties** | **Dict[str, str]** | Properties stored on the table, if supported by the server. | [optional] - -## Example - -```python -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of CreateEmptyTableRequest from a JSON string -create_empty_table_request_instance = CreateEmptyTableRequest.from_json(json) -# print the JSON string representation of the object -print(CreateEmptyTableRequest.to_json()) - -# convert the object into a dict -create_empty_table_request_dict = create_empty_table_request_instance.to_dict() -# create an instance of CreateEmptyTableRequest from a dict -create_empty_table_request_from_dict = CreateEmptyTableRequest.from_dict(create_empty_table_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/python/lance_namespace_urllib3_client/docs/CreateEmptyTableResponse.md b/python/lance_namespace_urllib3_client/docs/CreateEmptyTableResponse.md deleted file mode 100644 index e8fb1ab28..000000000 --- a/python/lance_namespace_urllib3_client/docs/CreateEmptyTableResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# CreateEmptyTableResponse - -Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transaction_id** | **str** | Optional transaction identifier | [optional] -**location** | **str** | | [optional] -**storage_options** | **Dict[str, str]** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] -**properties** | **Dict[str, str]** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] - -## Example - -```python -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of CreateEmptyTableResponse from a JSON string -create_empty_table_response_instance = CreateEmptyTableResponse.from_json(json) -# print the JSON string representation of the object -print(CreateEmptyTableResponse.to_json()) - -# convert the object into a dict -create_empty_table_response_dict = create_empty_table_response_instance.to_dict() -# create an instance of CreateEmptyTableResponse from a dict -create_empty_table_response_from_dict = CreateEmptyTableResponse.from_dict(create_empty_table_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/python/lance_namespace_urllib3_client/docs/CreateTableRequest.md b/python/lance_namespace_urllib3_client/docs/CreateTableRequest.md index 6dbf2bdc0..75b070968 100644 --- a/python/lance_namespace_urllib3_client/docs/CreateTableRequest.md +++ b/python/lance_namespace_urllib3_client/docs/CreateTableRequest.md @@ -1,6 +1,6 @@ # CreateTableRequest -Request for creating a table, excluding the Arrow IPC stream. +Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. ## Properties @@ -10,7 +10,8 @@ Name | Type | Description | Notes **context** | **Dict[str, str]** | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] **id** | **List[str]** | | [optional] **mode** | **str** | There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. | [optional] -**properties** | **Dict[str, str]** | Properties stored on the table, if supported by the implementation. | [optional] +**properties** | **Dict[str, str]** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] +**storage_options** | **Dict[str, str]** | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. | [optional] ## Example diff --git a/python/lance_namespace_urllib3_client/docs/CreateTableResponse.md b/python/lance_namespace_urllib3_client/docs/CreateTableResponse.md index 8c5eb308a..1f9ba233c 100644 --- a/python/lance_namespace_urllib3_client/docs/CreateTableResponse.md +++ b/python/lance_namespace_urllib3_client/docs/CreateTableResponse.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **location** | **str** | | [optional] **version** | **int** | | [optional] **storage_options** | **Dict[str, str]** | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] -**properties** | **Dict[str, str]** | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional] +**properties** | **Dict[str, str]** | Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. | [optional] ## Example diff --git a/python/lance_namespace_urllib3_client/docs/DataApi.md b/python/lance_namespace_urllib3_client/docs/DataApi.md index 04f0e2e1d..993c0b315 100644 --- a/python/lance_namespace_urllib3_client/docs/DataApi.md +++ b/python/lance_namespace_urllib3_client/docs/DataApi.md @@ -324,7 +324,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_table** -> CreateTableResponse create_table(id, body, delimiter=delimiter, mode=mode) +> CreateTableResponse create_table(id, body, delimiter=delimiter, mode=mode, properties=properties, storage_options=storage_options) Create a table with the given name @@ -338,6 +338,12 @@ REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +- `properties`: serialize as a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`; these are business logic properties + managed by the namespace implementation outside Lance context +- `storage_options`: serialize as a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure + write-time overrides for data and metadata written during table creation ### Example @@ -384,10 +390,12 @@ with lance_namespace_urllib3_client.ApiClient(configuration) as api_client: body = None # bytearray | Arrow IPC data delimiter = 'delimiter_example' # str | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional) mode = 'mode_example' # str | (optional) + properties = 'properties_example' # str | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. (optional) + storage_options = 'storage_options_example' # str | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. (optional) try: # Create a table with the given name - api_response = api_instance.create_table(id, body, delimiter=delimiter, mode=mode) + api_response = api_instance.create_table(id, body, delimiter=delimiter, mode=mode, properties=properties, storage_options=storage_options) print("The response of DataApi->create_table:\n") pprint(api_response) except Exception as e: @@ -405,6 +413,8 @@ Name | Type | Description | Notes **body** | **bytearray**| Arrow IPC data | **delimiter** | **str**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] **mode** | **str**| | [optional] + **properties** | **str**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] + **storage_options** | **str**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] ### Return type @@ -428,6 +438,7 @@ Name | Type | Description | Notes **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | **404** | A server-side problem that means can not find the specified resource. | - | +**409** | The request conflicts with the current state of the target resource. | - | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | diff --git a/python/lance_namespace_urllib3_client/docs/DeclareTableRequest.md b/python/lance_namespace_urllib3_client/docs/DeclareTableRequest.md index 5e4c735bb..46c45e943 100644 --- a/python/lance_namespace_urllib3_client/docs/DeclareTableRequest.md +++ b/python/lance_namespace_urllib3_client/docs/DeclareTableRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **id** | **List[str]** | | [optional] **location** | **str** | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] **vend_credentials** | **bool** | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] -**properties** | **Dict[str, str]** | Properties stored on the table, if supported by the server. | [optional] +**properties** | **Dict[str, str]** | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] ## Example diff --git a/python/lance_namespace_urllib3_client/docs/MetadataApi.md b/python/lance_namespace_urllib3_client/docs/MetadataApi.md index 88745ea5c..255c030e7 100644 --- a/python/lance_namespace_urllib3_client/docs/MetadataApi.md +++ b/python/lance_namespace_urllib3_client/docs/MetadataApi.md @@ -10,7 +10,6 @@ Method | HTTP request | Description [**batch_commit_tables**](MetadataApi.md#batch_commit_tables) | **POST** /v1/table/batch-commit | Atomically commit a batch of mixed table operations [**batch_create_table_versions**](MetadataApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables [**batch_delete_table_versions**](MetadataApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records -[**create_empty_table**](MetadataApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table [**create_namespace**](MetadataApi.md#create_namespace) | **POST** /v1/namespace/{id}/create | Create a new namespace [**create_table_index**](MetadataApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table [**create_table_scalar_index**](MetadataApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -666,113 +665,6 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_empty_table** -> CreateEmptyTableResponse create_empty_table(id, create_empty_table_request, delimiter=delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. -This is a metadata-only operation that records the table existence and sets up aspects like access control. - -For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory -to mark the table's existence without creating actual Lance data files. - -**Deprecated**: Use `DeclareTable` instead. - - -### Example - -* OAuth Authentication (OAuth2): -* Api Key Authentication (ApiKeyAuth): -* Bearer Authentication (BearerAuth): - -```python -import lance_namespace_urllib3_client -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse -from lance_namespace_urllib3_client.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost:2333 -# See configuration.py for a list of all supported configuration parameters. -configuration = lance_namespace_urllib3_client.Configuration( - host = "http://localhost:2333" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Configure API key authorization: ApiKeyAuth -configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' - -# Configure Bearer authorization: BearerAuth -configuration = lance_namespace_urllib3_client.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with lance_namespace_urllib3_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lance_namespace_urllib3_client.MetadataApi(api_client) - id = 'id_example' # str | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - create_empty_table_request = lance_namespace_urllib3_client.CreateEmptyTableRequest() # CreateEmptyTableRequest | - delimiter = 'delimiter_example' # str | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional) - - try: - # Create an empty table - api_response = api_instance.create_empty_table(id, create_empty_table_request, delimiter=delimiter) - print("The response of MetadataApi->create_empty_table:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MetadataApi->create_empty_table: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | - **create_empty_table_request** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | - **delimiter** | **str**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] - -### Return type - -[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md) - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Table properties result when creating an empty table | - | -**400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -**401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -**403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -**404** | A server-side problem that means can not find the specified resource. | - | -**409** | The request conflicts with the current state of the target resource. | - | -**503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -**5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **create_namespace** > CreateNamespaceResponse create_namespace(id, create_namespace_request, delimiter=delimiter) diff --git a/python/lance_namespace_urllib3_client/docs/TableApi.md b/python/lance_namespace_urllib3_client/docs/TableApi.md index b0d5f2631..0104af689 100644 --- a/python/lance_namespace_urllib3_client/docs/TableApi.md +++ b/python/lance_namespace_urllib3_client/docs/TableApi.md @@ -12,7 +12,6 @@ Method | HTTP request | Description [**batch_create_table_versions**](TableApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables [**batch_delete_table_versions**](TableApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records [**count_table_rows**](TableApi.md#count_table_rows) | **POST** /v1/table/{id}/count_rows | Count rows in a table -[**create_empty_table**](TableApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table [**create_table**](TableApi.md#create_table) | **POST** /v1/table/{id}/create | Create a table with the given name [**create_table_index**](TableApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table [**create_table_scalar_index**](TableApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -875,115 +874,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_empty_table** -> CreateEmptyTableResponse create_empty_table(id, create_empty_table_request, delimiter=delimiter) - -Create an empty table - -Create an empty table with the given name without touching storage. -This is a metadata-only operation that records the table existence and sets up aspects like access control. - -For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory -to mark the table's existence without creating actual Lance data files. - -**Deprecated**: Use `DeclareTable` instead. - - -### Example - -* OAuth Authentication (OAuth2): -* Api Key Authentication (ApiKeyAuth): -* Bearer Authentication (BearerAuth): - -```python -import lance_namespace_urllib3_client -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse -from lance_namespace_urllib3_client.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost:2333 -# See configuration.py for a list of all supported configuration parameters. -configuration = lance_namespace_urllib3_client.Configuration( - host = "http://localhost:2333" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Configure API key authorization: ApiKeyAuth -configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' - -# Configure Bearer authorization: BearerAuth -configuration = lance_namespace_urllib3_client.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with lance_namespace_urllib3_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lance_namespace_urllib3_client.TableApi(api_client) - id = 'id_example' # str | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. - create_empty_table_request = lance_namespace_urllib3_client.CreateEmptyTableRequest() # CreateEmptyTableRequest | - delimiter = 'delimiter_example' # str | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional) - - try: - # Create an empty table - api_response = api_instance.create_empty_table(id, create_empty_table_request, delimiter=delimiter) - print("The response of TableApi->create_empty_table:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling TableApi->create_empty_table: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | - **create_empty_table_request** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md)| | - **delimiter** | **str**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] - -### Return type - -[**CreateEmptyTableResponse**](CreateEmptyTableResponse.md) - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Table properties result when creating an empty table | - | -**400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | -**401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | -**403** | Forbidden. Authenticated user does not have the necessary permissions. | - | -**404** | A server-side problem that means can not find the specified resource. | - | -**409** | The request conflicts with the current state of the target resource. | - | -**503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | -**5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **create_table** -> CreateTableResponse create_table(id, body, delimiter=delimiter, mode=mode) +> CreateTableResponse create_table(id, body, delimiter=delimiter, mode=mode, properties=properties, storage_options=storage_options) Create a table with the given name @@ -997,6 +889,12 @@ REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +- `properties`: serialize as a single JSON-encoded query parameter such as + `properties={"user":"alice","team":"eng"}`; these are business logic properties + managed by the namespace implementation outside Lance context +- `storage_options`: serialize as a single JSON-encoded query parameter such as + `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure + write-time overrides for data and metadata written during table creation ### Example @@ -1043,10 +941,12 @@ with lance_namespace_urllib3_client.ApiClient(configuration) as api_client: body = None # bytearray | Arrow IPC data delimiter = 'delimiter_example' # str | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. (optional) mode = 'mode_example' # str | (optional) + properties = 'properties_example' # str | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. (optional) + storage_options = 'storage_options_example' # str | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. (optional) try: # Create a table with the given name - api_response = api_instance.create_table(id, body, delimiter=delimiter, mode=mode) + api_response = api_instance.create_table(id, body, delimiter=delimiter, mode=mode, properties=properties, storage_options=storage_options) print("The response of TableApi->create_table:\n") pprint(api_response) except Exception as e: @@ -1064,6 +964,8 @@ Name | Type | Description | Notes **body** | **bytearray**| Arrow IPC data | **delimiter** | **str**| An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | [optional] **mode** | **str**| | [optional] + **properties** | **str**| Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | [optional] + **storage_options** | **str**| Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | [optional] ### Return type @@ -1087,6 +989,7 @@ Name | Type | Description | Notes **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | **404** | A server-side problem that means can not find the specified resource. | - | +**409** | The request conflicts with the current state of the target resource. | - | **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - | **5XX** | A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes. | - | diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py index 159c9a8c2..2cda7b368 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py @@ -65,8 +65,6 @@ from lance_namespace_urllib3_client.models.commit_table_operation import CommitTableOperation from lance_namespace_urllib3_client.models.commit_table_result import CommitTableResult from lance_namespace_urllib3_client.models.count_table_rows_request import CountTableRowsRequest -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.models.create_table_index_request import CreateTableIndexRequest diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/data_api.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/data_api.py index 213cdd204..10adfe16e 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/data_api.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/data_api.py @@ -1036,6 +1036,8 @@ def create_table( body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Arrow IPC data")], delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, mode: Optional[StrictStr] = None, + properties: Annotated[Optional[StrictStr], Field(description="Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ")] = None, + storage_options: Annotated[Optional[StrictStr], Field(description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1051,7 +1053,7 @@ def create_table( ) -> CreateTableResponse: """Create a table with the given name - Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) :type id: str @@ -1061,6 +1063,10 @@ def create_table( :type delimiter: str :param mode: :type mode: str + :param properties: Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + :type properties: str + :param storage_options: Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + :type storage_options: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1088,6 +1094,8 @@ def create_table( body=body, delimiter=delimiter, mode=mode, + properties=properties, + storage_options=storage_options, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1100,6 +1108,7 @@ def create_table( '401': "ErrorResponse", '403': "ErrorResponse", '404': "ErrorResponse", + '409': "ErrorResponse", '503': "ErrorResponse", '5XX': "ErrorResponse", } @@ -1121,6 +1130,8 @@ def create_table_with_http_info( body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Arrow IPC data")], delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, mode: Optional[StrictStr] = None, + properties: Annotated[Optional[StrictStr], Field(description="Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ")] = None, + storage_options: Annotated[Optional[StrictStr], Field(description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1136,7 +1147,7 @@ def create_table_with_http_info( ) -> ApiResponse[CreateTableResponse]: """Create a table with the given name - Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) :type id: str @@ -1146,6 +1157,10 @@ def create_table_with_http_info( :type delimiter: str :param mode: :type mode: str + :param properties: Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + :type properties: str + :param storage_options: Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + :type storage_options: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1173,6 +1188,8 @@ def create_table_with_http_info( body=body, delimiter=delimiter, mode=mode, + properties=properties, + storage_options=storage_options, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1185,6 +1202,7 @@ def create_table_with_http_info( '401': "ErrorResponse", '403': "ErrorResponse", '404': "ErrorResponse", + '409': "ErrorResponse", '503': "ErrorResponse", '5XX': "ErrorResponse", } @@ -1206,6 +1224,8 @@ def create_table_without_preload_content( body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Arrow IPC data")], delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, mode: Optional[StrictStr] = None, + properties: Annotated[Optional[StrictStr], Field(description="Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ")] = None, + storage_options: Annotated[Optional[StrictStr], Field(description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1221,7 +1241,7 @@ def create_table_without_preload_content( ) -> RESTResponseType: """Create a table with the given name - Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) :type id: str @@ -1231,6 +1251,10 @@ def create_table_without_preload_content( :type delimiter: str :param mode: :type mode: str + :param properties: Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + :type properties: str + :param storage_options: Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + :type storage_options: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1258,6 +1282,8 @@ def create_table_without_preload_content( body=body, delimiter=delimiter, mode=mode, + properties=properties, + storage_options=storage_options, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1270,6 +1296,7 @@ def create_table_without_preload_content( '401': "ErrorResponse", '403': "ErrorResponse", '404': "ErrorResponse", + '409': "ErrorResponse", '503': "ErrorResponse", '5XX': "ErrorResponse", } @@ -1286,6 +1313,8 @@ def _create_table_serialize( body, delimiter, mode, + properties, + storage_options, _request_auth, _content_type, _headers, @@ -1318,6 +1347,14 @@ def _create_table_serialize( _query_params.append(('mode', mode)) + if properties is not None: + + _query_params.append(('properties', properties)) + + if storage_options is not None: + + _query_params.append(('storage_options', storage_options)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/metadata_api.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/metadata_api.py index dcda8776e..f899314e0 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/metadata_api.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/metadata_api.py @@ -31,8 +31,6 @@ from lance_namespace_urllib3_client.models.batch_create_table_versions_response import BatchCreateTableVersionsResponse from lance_namespace_urllib3_client.models.batch_delete_table_versions_request import BatchDeleteTableVersionsRequest from lance_namespace_urllib3_client.models.batch_delete_table_versions_response import BatchDeleteTableVersionsResponse -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.models.create_table_index_request import CreateTableIndexRequest @@ -2036,338 +2034,6 @@ def _batch_delete_table_versions_serialize( - @validate_call - def create_empty_table( - self, - id: Annotated[StrictStr, Field(description="`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ")], - create_empty_table_request: CreateEmptyTableRequest, - delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateEmptyTableResponse: - """(Deprecated) Create an empty table - - Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - - :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) - :type id: str - :param create_empty_table_request: (required) - :type create_empty_table_request: CreateEmptyTableRequest - :param delimiter: An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - :type delimiter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/table/{id}/create-empty is deprecated.", DeprecationWarning) - - _param = self._create_empty_table_serialize( - id=id, - create_empty_table_request=create_empty_table_request, - delimiter=delimiter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateEmptyTableResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '409': "ErrorResponse", - '503': "ErrorResponse", - '5XX': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def create_empty_table_with_http_info( - self, - id: Annotated[StrictStr, Field(description="`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ")], - create_empty_table_request: CreateEmptyTableRequest, - delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateEmptyTableResponse]: - """(Deprecated) Create an empty table - - Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - - :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) - :type id: str - :param create_empty_table_request: (required) - :type create_empty_table_request: CreateEmptyTableRequest - :param delimiter: An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - :type delimiter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/table/{id}/create-empty is deprecated.", DeprecationWarning) - - _param = self._create_empty_table_serialize( - id=id, - create_empty_table_request=create_empty_table_request, - delimiter=delimiter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateEmptyTableResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '409': "ErrorResponse", - '503': "ErrorResponse", - '5XX': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def create_empty_table_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ")], - create_empty_table_request: CreateEmptyTableRequest, - delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """(Deprecated) Create an empty table - - Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - - :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) - :type id: str - :param create_empty_table_request: (required) - :type create_empty_table_request: CreateEmptyTableRequest - :param delimiter: An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - :type delimiter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/table/{id}/create-empty is deprecated.", DeprecationWarning) - - _param = self._create_empty_table_serialize( - id=id, - create_empty_table_request=create_empty_table_request, - delimiter=delimiter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateEmptyTableResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '409': "ErrorResponse", - '503': "ErrorResponse", - '5XX': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_empty_table_serialize( - self, - id, - create_empty_table_request, - delimiter, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params['id'] = id - # process the query parameters - if delimiter is not None: - - _query_params.append(('delimiter', delimiter)) - - # process the header parameters - # process the form parameters - # process the body parameter - if create_empty_table_request is not None: - _body_params = create_empty_table_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'OAuth2', - 'ApiKeyAuth', - 'BearerAuth' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/table/{id}/create-empty', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call def create_namespace( self, diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/table_api.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/table_api.py index e533943ab..33371950b 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/table_api.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/table_api.py @@ -33,8 +33,6 @@ from lance_namespace_urllib3_client.models.batch_delete_table_versions_request import BatchDeleteTableVersionsRequest from lance_namespace_urllib3_client.models.batch_delete_table_versions_response import BatchDeleteTableVersionsResponse from lance_namespace_urllib3_client.models.count_table_rows_request import CountTableRowsRequest -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse from lance_namespace_urllib3_client.models.create_table_index_request import CreateTableIndexRequest from lance_namespace_urllib3_client.models.create_table_index_response import CreateTableIndexResponse from lance_namespace_urllib3_client.models.create_table_response import CreateTableResponse @@ -2686,338 +2684,6 @@ def _count_table_rows_serialize( - @validate_call - def create_empty_table( - self, - id: Annotated[StrictStr, Field(description="`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ")], - create_empty_table_request: CreateEmptyTableRequest, - delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateEmptyTableResponse: - """(Deprecated) Create an empty table - - Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - - :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) - :type id: str - :param create_empty_table_request: (required) - :type create_empty_table_request: CreateEmptyTableRequest - :param delimiter: An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - :type delimiter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/table/{id}/create-empty is deprecated.", DeprecationWarning) - - _param = self._create_empty_table_serialize( - id=id, - create_empty_table_request=create_empty_table_request, - delimiter=delimiter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateEmptyTableResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '409': "ErrorResponse", - '503': "ErrorResponse", - '5XX': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def create_empty_table_with_http_info( - self, - id: Annotated[StrictStr, Field(description="`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ")], - create_empty_table_request: CreateEmptyTableRequest, - delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateEmptyTableResponse]: - """(Deprecated) Create an empty table - - Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - - :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) - :type id: str - :param create_empty_table_request: (required) - :type create_empty_table_request: CreateEmptyTableRequest - :param delimiter: An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - :type delimiter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/table/{id}/create-empty is deprecated.", DeprecationWarning) - - _param = self._create_empty_table_serialize( - id=id, - create_empty_table_request=create_empty_table_request, - delimiter=delimiter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateEmptyTableResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '409': "ErrorResponse", - '503': "ErrorResponse", - '5XX': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def create_empty_table_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="`string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. ")], - create_empty_table_request: CreateEmptyTableRequest, - delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """(Deprecated) Create an empty table - - Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - - :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) - :type id: str - :param create_empty_table_request: (required) - :type create_empty_table_request: CreateEmptyTableRequest - :param delimiter: An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. - :type delimiter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - warnings.warn("POST /v1/table/{id}/create-empty is deprecated.", DeprecationWarning) - - _param = self._create_empty_table_serialize( - id=id, - create_empty_table_request=create_empty_table_request, - delimiter=delimiter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateEmptyTableResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '409': "ErrorResponse", - '503': "ErrorResponse", - '5XX': "ErrorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_empty_table_serialize( - self, - id, - create_empty_table_request, - delimiter, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params['id'] = id - # process the query parameters - if delimiter is not None: - - _query_params.append(('delimiter', delimiter)) - - # process the header parameters - # process the form parameters - # process the body parameter - if create_empty_table_request is not None: - _body_params = create_empty_table_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'OAuth2', - 'ApiKeyAuth', - 'BearerAuth' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/table/{id}/create-empty', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call def create_table( self, @@ -3025,6 +2691,8 @@ def create_table( body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Arrow IPC data")], delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, mode: Optional[StrictStr] = None, + properties: Annotated[Optional[StrictStr], Field(description="Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ")] = None, + storage_options: Annotated[Optional[StrictStr], Field(description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3040,7 +2708,7 @@ def create_table( ) -> CreateTableResponse: """Create a table with the given name - Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) :type id: str @@ -3050,6 +2718,10 @@ def create_table( :type delimiter: str :param mode: :type mode: str + :param properties: Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + :type properties: str + :param storage_options: Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + :type storage_options: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3077,6 +2749,8 @@ def create_table( body=body, delimiter=delimiter, mode=mode, + properties=properties, + storage_options=storage_options, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3089,6 +2763,7 @@ def create_table( '401': "ErrorResponse", '403': "ErrorResponse", '404': "ErrorResponse", + '409': "ErrorResponse", '503': "ErrorResponse", '5XX': "ErrorResponse", } @@ -3110,6 +2785,8 @@ def create_table_with_http_info( body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Arrow IPC data")], delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, mode: Optional[StrictStr] = None, + properties: Annotated[Optional[StrictStr], Field(description="Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ")] = None, + storage_options: Annotated[Optional[StrictStr], Field(description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3125,7 +2802,7 @@ def create_table_with_http_info( ) -> ApiResponse[CreateTableResponse]: """Create a table with the given name - Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) :type id: str @@ -3135,6 +2812,10 @@ def create_table_with_http_info( :type delimiter: str :param mode: :type mode: str + :param properties: Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + :type properties: str + :param storage_options: Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + :type storage_options: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3162,6 +2843,8 @@ def create_table_with_http_info( body=body, delimiter=delimiter, mode=mode, + properties=properties, + storage_options=storage_options, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3174,6 +2857,7 @@ def create_table_with_http_info( '401': "ErrorResponse", '403': "ErrorResponse", '404': "ErrorResponse", + '409': "ErrorResponse", '503': "ErrorResponse", '5XX': "ErrorResponse", } @@ -3195,6 +2879,8 @@ def create_table_without_preload_content( body: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Arrow IPC data")], delimiter: Annotated[Optional[StrictStr], Field(description="An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. ")] = None, mode: Optional[StrictStr] = None, + properties: Annotated[Optional[StrictStr], Field(description="Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. ")] = None, + storage_options: Annotated[Optional[StrictStr], Field(description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3210,7 +2896,7 @@ def create_table_without_preload_content( ) -> RESTResponseType: """Create a table with the given name - Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name + Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation :param id: `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. (required) :type id: str @@ -3220,6 +2906,10 @@ def create_table_without_preload_content( :type delimiter: str :param mode: :type mode: str + :param properties: Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. + :type properties: str + :param storage_options: Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. + :type storage_options: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3247,6 +2937,8 @@ def create_table_without_preload_content( body=body, delimiter=delimiter, mode=mode, + properties=properties, + storage_options=storage_options, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3259,6 +2951,7 @@ def create_table_without_preload_content( '401': "ErrorResponse", '403': "ErrorResponse", '404': "ErrorResponse", + '409': "ErrorResponse", '503': "ErrorResponse", '5XX': "ErrorResponse", } @@ -3275,6 +2968,8 @@ def _create_table_serialize( body, delimiter, mode, + properties, + storage_options, _request_auth, _content_type, _headers, @@ -3307,6 +3002,14 @@ def _create_table_serialize( _query_params.append(('mode', mode)) + if properties is not None: + + _query_params.append(('properties', properties)) + + if storage_options is not None: + + _query_params.append(('storage_options', storage_options)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py index f64411049..3ae91bec9 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py @@ -42,8 +42,6 @@ from lance_namespace_urllib3_client.models.commit_table_operation import CommitTableOperation from lance_namespace_urllib3_client.models.commit_table_result import CommitTableResult from lance_namespace_urllib3_client.models.count_table_rows_request import CountTableRowsRequest -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.models.create_table_index_request import CreateTableIndexRequest diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_request.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_request.py deleted file mode 100644 index 6a030fb83..000000000 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_request.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - Lance Namespace Specification - - This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from lance_namespace_urllib3_client.models.identity import Identity -from typing import Optional, Set -from typing_extensions import Self - -class CreateEmptyTableRequest(BaseModel): - """ - Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - """ # noqa: E501 - identity: Optional[Identity] = None - context: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-: `. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. ") - id: Optional[List[StrictStr]] = None - location: Optional[StrictStr] = Field(default=None, description="Optional storage location for the table. If not provided, the namespace implementation should determine the table location. ") - vend_credentials: Optional[StrictBool] = Field(default=None, description="Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. ") - properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties stored on the table, if supported by the server. ") - __properties: ClassVar[List[str]] = ["identity", "context", "id", "location", "vend_credentials", "properties"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateEmptyTableRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of identity - if self.identity: - _dict['identity'] = self.identity.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateEmptyTableRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "identity": Identity.from_dict(obj["identity"]) if obj.get("identity") is not None else None, - "context": obj.get("context"), - "id": obj.get("id"), - "location": obj.get("location"), - "vend_credentials": obj.get("vend_credentials"), - "properties": obj.get("properties") - }) - return _obj - - diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_response.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_response.py deleted file mode 100644 index af7573193..000000000 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_empty_table_response.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Lance Namespace Specification - - This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class CreateEmptyTableResponse(BaseModel): - """ - Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. - """ # noqa: E501 - transaction_id: Optional[StrictStr] = Field(default=None, description="Optional transaction identifier") - location: Optional[StrictStr] = None - storage_options: Optional[Dict[str, StrictStr]] = Field(default=None, description="Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. ") - properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. ") - __properties: ClassVar[List[str]] = ["transaction_id", "location", "storage_options", "properties"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateEmptyTableResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateEmptyTableResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "transaction_id": obj.get("transaction_id"), - "location": obj.get("location"), - "storage_options": obj.get("storage_options"), - "properties": obj.get("properties") - }) - return _obj - - diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_request.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_request.py index 29fe5dff4..1bdba3879 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_request.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_request.py @@ -25,14 +25,15 @@ class CreateTableRequest(BaseModel): """ - Request for creating a table, excluding the Arrow IPC stream. + Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. """ # noqa: E501 identity: Optional[Identity] = None context: Optional[Dict[str, StrictStr]] = Field(default=None, description="Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-: `. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. ") id: Optional[List[StrictStr]] = None mode: Optional[StrictStr] = Field(default=None, description="There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. ") - properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties stored on the table, if supported by the implementation. ") - __properties: ClassVar[List[str]] = ["identity", "context", "id", "mode", "properties"] + properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. ") + storage_options: Optional[Dict[str, StrictStr]] = Field(default=None, description="Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. ") + __properties: ClassVar[List[str]] = ["identity", "context", "id", "mode", "properties", "storage_options"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "context": obj.get("context"), "id": obj.get("id"), "mode": obj.get("mode"), - "properties": obj.get("properties") + "properties": obj.get("properties"), + "storage_options": obj.get("storage_options") }) return _obj diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_response.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_response.py index 7c493b9e1..67b96315e 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_response.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_table_response.py @@ -31,7 +31,7 @@ class CreateTableResponse(BaseModel): location: Optional[StrictStr] = None version: Optional[Annotated[int, Field(strict=True, ge=0)]] = None storage_options: Optional[Dict[str, StrictStr]] = Field(default=None, description="Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. ") - properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. ") + properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. ") __properties: ClassVar[List[str]] = ["transaction_id", "location", "version", "storage_options", "properties"] model_config = ConfigDict( diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/declare_table_request.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/declare_table_request.py index d817fef27..a90b1f2da 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/declare_table_request.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/declare_table_request.py @@ -32,7 +32,7 @@ class DeclareTableRequest(BaseModel): id: Optional[List[StrictStr]] = None location: Optional[StrictStr] = Field(default=None, description="Optional storage location for the table. If not provided, the namespace implementation should determine the table location. ") vend_credentials: Optional[StrictBool] = Field(default=None, description="Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. ") - properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="Properties stored on the table, if supported by the server. ") + properties: Optional[Dict[str, StrictStr]] = Field(default=None, description="Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. ") __properties: ClassVar[List[str]] = ["identity", "context", "id", "location", "vend_credentials", "properties"] model_config = ConfigDict( diff --git a/python/lance_namespace_urllib3_client/test/test_create_empty_table_request.py b/python/lance_namespace_urllib3_client/test/test_create_empty_table_request.py deleted file mode 100644 index 3847370e0..000000000 --- a/python/lance_namespace_urllib3_client/test/test_create_empty_table_request.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - Lance Namespace Specification - - This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lance_namespace_urllib3_client.models.create_empty_table_request import CreateEmptyTableRequest - -class TestCreateEmptyTableRequest(unittest.TestCase): - """CreateEmptyTableRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CreateEmptyTableRequest: - """Test CreateEmptyTableRequest - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateEmptyTableRequest` - """ - model = CreateEmptyTableRequest() - if include_optional: - return CreateEmptyTableRequest( - identity = lance_namespace_urllib3_client.models.identity.Identity( - api_key = '', - auth_token = '', ), - context = { - 'key' : '' - }, - id = [ - '' - ], - location = '', - vend_credentials = True, - properties = { - 'key' : '' - } - ) - else: - return CreateEmptyTableRequest( - ) - """ - - def testCreateEmptyTableRequest(self): - """Test CreateEmptyTableRequest""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/python/lance_namespace_urllib3_client/test/test_create_empty_table_response.py b/python/lance_namespace_urllib3_client/test/test_create_empty_table_response.py deleted file mode 100644 index e5811650d..000000000 --- a/python/lance_namespace_urllib3_client/test/test_create_empty_table_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Lance Namespace Specification - - This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lance_namespace_urllib3_client.models.create_empty_table_response import CreateEmptyTableResponse - -class TestCreateEmptyTableResponse(unittest.TestCase): - """CreateEmptyTableResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CreateEmptyTableResponse: - """Test CreateEmptyTableResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CreateEmptyTableResponse` - """ - model = CreateEmptyTableResponse() - if include_optional: - return CreateEmptyTableResponse( - transaction_id = '', - location = '', - storage_options = { - 'key' : '' - }, - properties = {owner=Ralph, created_at=1452120468} - ) - else: - return CreateEmptyTableResponse( - ) - """ - - def testCreateEmptyTableResponse(self): - """Test CreateEmptyTableResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/python/lance_namespace_urllib3_client/test/test_create_table_request.py b/python/lance_namespace_urllib3_client/test/test_create_table_request.py index f7bb73b75..bc94ff86b 100644 --- a/python/lance_namespace_urllib3_client/test/test_create_table_request.py +++ b/python/lance_namespace_urllib3_client/test/test_create_table_request.py @@ -46,6 +46,9 @@ def make_instance(self, include_optional) -> CreateTableRequest: ], mode = '', properties = { + 'key' : '' + }, + storage_options = { 'key' : '' } ) diff --git a/python/lance_namespace_urllib3_client/test/test_metadata_api.py b/python/lance_namespace_urllib3_client/test/test_metadata_api.py index 4acfa2d70..d3b00d51f 100644 --- a/python/lance_namespace_urllib3_client/test/test_metadata_api.py +++ b/python/lance_namespace_urllib3_client/test/test_metadata_api.py @@ -68,13 +68,6 @@ def test_batch_delete_table_versions(self) -> None: """ pass - def test_create_empty_table(self) -> None: - """Test case for create_empty_table - - Create an empty table - """ - pass - def test_create_namespace(self) -> None: """Test case for create_namespace diff --git a/python/lance_namespace_urllib3_client/test/test_table_api.py b/python/lance_namespace_urllib3_client/test/test_table_api.py index f1ecbdb57..6bb4033da 100644 --- a/python/lance_namespace_urllib3_client/test/test_table_api.py +++ b/python/lance_namespace_urllib3_client/test/test_table_api.py @@ -82,13 +82,6 @@ def test_count_table_rows(self) -> None: """ pass - def test_create_empty_table(self) -> None: - """Test case for create_empty_table - - Create an empty table - """ - pass - def test_create_table(self) -> None: """Test case for create_table diff --git a/rust/lance-namespace-reqwest-client/README.md b/rust/lance-namespace-reqwest-client/README.md index ac49b45cc..7a444a2b7 100644 --- a/rust/lance-namespace-reqwest-client/README.md +++ b/rust/lance-namespace-reqwest-client/README.md @@ -56,7 +56,6 @@ Class | Method | HTTP request | Description *MetadataApi* | [**batch_commit_tables**](docs/MetadataApi.md#batch_commit_tables) | **POST** /v1/table/batch-commit | Atomically commit a batch of mixed table operations *MetadataApi* | [**batch_create_table_versions**](docs/MetadataApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *MetadataApi* | [**batch_delete_table_versions**](docs/MetadataApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records -*MetadataApi* | [**create_empty_table**](docs/MetadataApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table *MetadataApi* | [**create_namespace**](docs/MetadataApi.md#create_namespace) | **POST** /v1/namespace/{id}/create | Create a new namespace *MetadataApi* | [**create_table_index**](docs/MetadataApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table *MetadataApi* | [**create_table_scalar_index**](docs/MetadataApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -101,7 +100,6 @@ Class | Method | HTTP request | Description *TableApi* | [**batch_create_table_versions**](docs/TableApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables *TableApi* | [**batch_delete_table_versions**](docs/TableApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records *TableApi* | [**count_table_rows**](docs/TableApi.md#count_table_rows) | **POST** /v1/table/{id}/count_rows | Count rows in a table -*TableApi* | [**create_empty_table**](docs/TableApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table *TableApi* | [**create_table**](docs/TableApi.md#create_table) | **POST** /v1/table/{id}/create | Create a table with the given name *TableApi* | [**create_table_index**](docs/TableApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table *TableApi* | [**create_table_scalar_index**](docs/TableApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -174,8 +172,6 @@ Class | Method | HTTP request | Description - [CommitTableOperation](docs/CommitTableOperation.md) - [CommitTableResult](docs/CommitTableResult.md) - [CountTableRowsRequest](docs/CountTableRowsRequest.md) - - [CreateEmptyTableRequest](docs/CreateEmptyTableRequest.md) - - [CreateEmptyTableResponse](docs/CreateEmptyTableResponse.md) - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [CreateTableIndexRequest](docs/CreateTableIndexRequest.md) diff --git a/rust/lance-namespace-reqwest-client/docs/CreateEmptyTableRequest.md b/rust/lance-namespace-reqwest-client/docs/CreateEmptyTableRequest.md deleted file mode 100644 index 4129821af..000000000 --- a/rust/lance-namespace-reqwest-client/docs/CreateEmptyTableRequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateEmptyTableRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identity** | Option<[**models::Identity**](Identity.md)> | | [optional] -**context** | Option<**std::collections::HashMap**> | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-: `. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] -**id** | Option<**Vec**> | | [optional] -**location** | Option<**String**> | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] -**vend_credentials** | Option<**bool**> | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] -**properties** | Option<**std::collections::HashMap**> | Properties stored on the table, if supported by the server. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rust/lance-namespace-reqwest-client/docs/CreateEmptyTableResponse.md b/rust/lance-namespace-reqwest-client/docs/CreateEmptyTableResponse.md deleted file mode 100644 index 16b655e85..000000000 --- a/rust/lance-namespace-reqwest-client/docs/CreateEmptyTableResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# CreateEmptyTableResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transaction_id** | Option<**String**> | Optional transaction identifier | [optional] -**location** | Option<**String**> | | [optional] -**storage_options** | Option<**std::collections::HashMap**> | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] -**properties** | Option<**std::collections::HashMap**> | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional][default to {}] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/rust/lance-namespace-reqwest-client/docs/CreateTableRequest.md b/rust/lance-namespace-reqwest-client/docs/CreateTableRequest.md index 3939dbd04..ad35b4c10 100644 --- a/rust/lance-namespace-reqwest-client/docs/CreateTableRequest.md +++ b/rust/lance-namespace-reqwest-client/docs/CreateTableRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **context** | Option<**std::collections::HashMap**> | Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-: `. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. | [optional] **id** | Option<**Vec**> | | [optional] **mode** | Option<**String**> | There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. | [optional] -**properties** | Option<**std::collections::HashMap**> | Properties stored on the table, if supported by the implementation. | [optional] +**properties** | Option<**std::collections::HashMap**> | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] +**storage_options** | Option<**std::collections::HashMap**> | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/lance-namespace-reqwest-client/docs/CreateTableResponse.md b/rust/lance-namespace-reqwest-client/docs/CreateTableResponse.md index 657c9ac96..ca7636fea 100644 --- a/rust/lance-namespace-reqwest-client/docs/CreateTableResponse.md +++ b/rust/lance-namespace-reqwest-client/docs/CreateTableResponse.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **location** | Option<**String**> | | [optional] **version** | Option<**i64**> | | [optional] **storage_options** | Option<**std::collections::HashMap**> | Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. | [optional] -**properties** | Option<**std::collections::HashMap**> | If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. | [optional][default to {}] +**properties** | Option<**std::collections::HashMap**> | Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. | [optional][default to {}] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/lance-namespace-reqwest-client/docs/DataApi.md b/rust/lance-namespace-reqwest-client/docs/DataApi.md index 9feb8d4c1..f40c21c22 100644 --- a/rust/lance-namespace-reqwest-client/docs/DataApi.md +++ b/rust/lance-namespace-reqwest-client/docs/DataApi.md @@ -115,10 +115,10 @@ Name | Type | Description | Required | Notes ## create_table -> models::CreateTableResponse create_table(id, body, delimiter, mode) +> models::CreateTableResponse create_table(id, body, delimiter, mode, properties, storage_options) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Parameters @@ -129,6 +129,8 @@ Name | Type | Description | Required | Notes **body** | **Vec** | Arrow IPC data | [required] | **delimiter** | Option<**String**> | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | | **mode** | Option<**String**> | | | +**properties** | Option<**String**> | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | | +**storage_options** | Option<**String**> | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | | ### Return type diff --git a/rust/lance-namespace-reqwest-client/docs/DeclareTableRequest.md b/rust/lance-namespace-reqwest-client/docs/DeclareTableRequest.md index 7ff39fc6f..1b37a296b 100644 --- a/rust/lance-namespace-reqwest-client/docs/DeclareTableRequest.md +++ b/rust/lance-namespace-reqwest-client/docs/DeclareTableRequest.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | Option<**Vec**> | | [optional] **location** | Option<**String**> | Optional storage location for the table. If not provided, the namespace implementation should determine the table location. | [optional] **vend_credentials** | Option<**bool**> | Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. | [optional] -**properties** | Option<**std::collections::HashMap**> | Properties stored on the table, if supported by the server. | [optional] +**properties** | Option<**std::collections::HashMap**> | Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/lance-namespace-reqwest-client/docs/MetadataApi.md b/rust/lance-namespace-reqwest-client/docs/MetadataApi.md index 105190f9d..018e9665e 100644 --- a/rust/lance-namespace-reqwest-client/docs/MetadataApi.md +++ b/rust/lance-namespace-reqwest-client/docs/MetadataApi.md @@ -10,7 +10,6 @@ Method | HTTP request | Description [**batch_commit_tables**](MetadataApi.md#batch_commit_tables) | **POST** /v1/table/batch-commit | Atomically commit a batch of mixed table operations [**batch_create_table_versions**](MetadataApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables [**batch_delete_table_versions**](MetadataApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records -[**create_empty_table**](MetadataApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table [**create_namespace**](MetadataApi.md#create_namespace) | **POST** /v1/namespace/{id}/create | Create a new namespace [**create_table_index**](MetadataApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table [**create_table_scalar_index**](MetadataApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -234,38 +233,6 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## create_empty_table - -> models::CreateEmptyTableResponse create_empty_table(id, create_empty_table_request, delimiter) -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | [required] | -**create_empty_table_request** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md) | | [required] | -**delimiter** | Option<**String**> | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | | - -### Return type - -[**models::CreateEmptyTableResponse**](CreateEmptyTableResponse.md) - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## create_namespace > models::CreateNamespaceResponse create_namespace(id, create_namespace_request, delimiter) diff --git a/rust/lance-namespace-reqwest-client/docs/TableApi.md b/rust/lance-namespace-reqwest-client/docs/TableApi.md index d9ff91a54..4cc057445 100644 --- a/rust/lance-namespace-reqwest-client/docs/TableApi.md +++ b/rust/lance-namespace-reqwest-client/docs/TableApi.md @@ -12,7 +12,6 @@ Method | HTTP request | Description [**batch_create_table_versions**](TableApi.md#batch_create_table_versions) | **POST** /v1/table/version/batch-create | Atomically create versions for multiple tables [**batch_delete_table_versions**](TableApi.md#batch_delete_table_versions) | **POST** /v1/table/{id}/version/delete | Delete table version records [**count_table_rows**](TableApi.md#count_table_rows) | **POST** /v1/table/{id}/count_rows | Count rows in a table -[**create_empty_table**](TableApi.md#create_empty_table) | **POST** /v1/table/{id}/create-empty | Create an empty table [**create_table**](TableApi.md#create_table) | **POST** /v1/table/{id}/create | Create a table with the given name [**create_table_index**](TableApi.md#create_table_index) | **POST** /v1/table/{id}/create_index | Create an index on a table [**create_table_scalar_index**](TableApi.md#create_table_scalar_index) | **POST** /v1/table/{id}/create_scalar_index | Create a scalar index on a table @@ -302,44 +301,12 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## create_empty_table - -> models::CreateEmptyTableResponse create_empty_table(id, create_empty_table_request, delimiter) -Create an empty table - -Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **String** | `string identifier` of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace. | [required] | -**create_empty_table_request** | [**CreateEmptyTableRequest**](CreateEmptyTableRequest.md) | | [required] | -**delimiter** | Option<**String**> | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | | - -### Return type - -[**models::CreateEmptyTableResponse**](CreateEmptyTableResponse.md) - -### Authorization - -[OAuth2](../README.md#OAuth2), [ApiKeyAuth](../README.md#ApiKeyAuth), [BearerAuth](../README.md#BearerAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - ## create_table -> models::CreateTableResponse create_table(id, body, delimiter, mode) +> models::CreateTableResponse create_table(id, body, delimiter, mode, properties, storage_options) Create a table with the given name -Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name +Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation ### Parameters @@ -350,6 +317,8 @@ Name | Type | Description | Required | Notes **body** | **Vec** | Arrow IPC data | [required] | **delimiter** | Option<**String**> | An optional delimiter of the `string identifier`, following the Lance Namespace spec. When not specified, the `$` delimiter must be used. | | **mode** | Option<**String**> | | | +**properties** | Option<**String**> | Business logic properties managed by the namespace implementation outside Lance context. The map is translated to a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`. | | +**storage_options** | Option<**String**> | Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. The map is translated to a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`. | | ### Return type diff --git a/rust/lance-namespace-reqwest-client/src/apis/data_api.rs b/rust/lance-namespace-reqwest-client/src/apis/data_api.rs index 579d5426d..ca5f6aa13 100644 --- a/rust/lance-namespace-reqwest-client/src/apis/data_api.rs +++ b/rust/lance-namespace-reqwest-client/src/apis/data_api.rs @@ -62,6 +62,7 @@ pub enum CreateTableError { Status401(models::ErrorResponse), Status403(models::ErrorResponse), Status404(models::ErrorResponse), + Status409(models::ErrorResponse), Status503(models::ErrorResponse), Status5XX(models::ErrorResponse), UnknownValue(serde_json::Value), @@ -317,13 +318,15 @@ pub async fn count_table_rows(configuration: &configuration::Configuration, id: } } -/// Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name -pub async fn create_table(configuration: &configuration::Configuration, id: &str, body: Vec, delimiter: Option<&str>, mode: Option<&str>) -> Result> { +/// Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation +pub async fn create_table(configuration: &configuration::Configuration, id: &str, body: Vec, delimiter: Option<&str>, mode: Option<&str>, properties: Option<&str>, storage_options: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_id = id; let p_body = body; let p_delimiter = delimiter; let p_mode = mode; + let p_properties = properties; + let p_storage_options = storage_options; let uri_str = format!("{}/v1/table/{id}/create", configuration.base_path, id=crate::apis::urlencode(p_id)); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -334,6 +337,12 @@ pub async fn create_table(configuration: &configuration::Configuration, id: &str if let Some(ref param_value) = p_mode { req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_properties { + req_builder = req_builder.query(&[("properties", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_storage_options { + req_builder = req_builder.query(&[("storage_options", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/rust/lance-namespace-reqwest-client/src/apis/metadata_api.rs b/rust/lance-namespace-reqwest-client/src/apis/metadata_api.rs index 277bb386b..74b12f8ed 100644 --- a/rust/lance-namespace-reqwest-client/src/apis/metadata_api.rs +++ b/rust/lance-namespace-reqwest-client/src/apis/metadata_api.rs @@ -96,20 +96,6 @@ pub enum BatchDeleteTableVersionsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`create_empty_table`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateEmptyTableError { - Status400(models::ErrorResponse), - Status401(models::ErrorResponse), - Status403(models::ErrorResponse), - Status404(models::ErrorResponse), - Status409(models::ErrorResponse), - Status503(models::ErrorResponse), - Status5XX(models::ErrorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`create_namespace`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -852,63 +838,6 @@ pub async fn batch_delete_table_versions(configuration: &configuration::Configur } } -/// Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. -pub async fn create_empty_table(configuration: &configuration::Configuration, id: &str, create_empty_table_request: models::CreateEmptyTableRequest, delimiter: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; - let p_create_empty_table_request = create_empty_table_request; - let p_delimiter = delimiter; - - let uri_str = format!("{}/v1/table/{id}/create-empty", configuration.base_path, id=crate::apis::urlencode(p_id)); - let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_delimiter { - req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.oauth_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("x-api-key", value); - }; - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_create_empty_table_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateEmptyTableResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateEmptyTableResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - /// Create new namespace `id`. During the creation process, the implementation may modify user-provided `properties`, such as adding additional properties like `created_at` to user-provided properties, omitting any specific property, or performing actions based on any property value. pub async fn create_namespace(configuration: &configuration::Configuration, id: &str, create_namespace_request: models::CreateNamespaceRequest, delimiter: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions diff --git a/rust/lance-namespace-reqwest-client/src/apis/table_api.rs b/rust/lance-namespace-reqwest-client/src/apis/table_api.rs index 3d285b639..288ec69f9 100644 --- a/rust/lance-namespace-reqwest-client/src/apis/table_api.rs +++ b/rust/lance-namespace-reqwest-client/src/apis/table_api.rs @@ -121,20 +121,6 @@ pub enum CountTableRowsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`create_empty_table`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateEmptyTableError { - Status400(models::ErrorResponse), - Status401(models::ErrorResponse), - Status403(models::ErrorResponse), - Status404(models::ErrorResponse), - Status409(models::ErrorResponse), - Status503(models::ErrorResponse), - Status5XX(models::ErrorResponse), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`create_table`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -143,6 +129,7 @@ pub enum CreateTableError { Status401(models::ErrorResponse), Status403(models::ErrorResponse), Status404(models::ErrorResponse), + Status409(models::ErrorResponse), Status503(models::ErrorResponse), Status5XX(models::ErrorResponse), UnknownValue(serde_json::Value), @@ -1012,70 +999,15 @@ pub async fn count_table_rows(configuration: &configuration::Configuration, id: } } -/// Create an empty table with the given name without touching storage. This is a metadata-only operation that records the table existence and sets up aspects like access control. For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory to mark the table's existence without creating actual Lance data files. **Deprecated**: Use `DeclareTable` instead. -pub async fn create_empty_table(configuration: &configuration::Configuration, id: &str, create_empty_table_request: models::CreateEmptyTableRequest, delimiter: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_id = id; - let p_create_empty_table_request = create_empty_table_request; - let p_delimiter = delimiter; - - let uri_str = format!("{}/v1/table/{id}/create-empty", configuration.base_path, id=crate::apis::urlencode(p_id)); - let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_delimiter { - req_builder = req_builder.query(&[("delimiter", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.oauth_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("x-api-key", value); - }; - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_create_empty_table_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateEmptyTableResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateEmptyTableResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name -pub async fn create_table(configuration: &configuration::Configuration, id: &str, body: Vec, delimiter: Option<&str>, mode: Option<&str>) -> Result> { +/// Create table `id` in the namespace with the given data in Arrow IPC stream. The schema of the Arrow IPC stream is used as the table schema. If the stream is empty, the API creates a new empty table. REST NAMESPACE ONLY REST namespace uses Arrow IPC stream as the request body. It passes in the `CreateTableRequest` information in the following way: - `id`: pass through path parameter of the same name - `mode`: pass through query parameter of the same name - `properties`: serialize as a single JSON-encoded query parameter such as `properties={\"user\":\"alice\",\"team\":\"eng\"}`; these are business logic properties managed by the namespace implementation outside Lance context - `storage_options`: serialize as a single JSON-encoded query parameter such as `storage_options={\"aws_region\":\"us-east-1\",\"timeout\":\"30s\"}`; these configure write-time overrides for data and metadata written during table creation +pub async fn create_table(configuration: &configuration::Configuration, id: &str, body: Vec, delimiter: Option<&str>, mode: Option<&str>, properties: Option<&str>, storage_options: Option<&str>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_id = id; let p_body = body; let p_delimiter = delimiter; let p_mode = mode; + let p_properties = properties; + let p_storage_options = storage_options; let uri_str = format!("{}/v1/table/{id}/create", configuration.base_path, id=crate::apis::urlencode(p_id)); let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str); @@ -1086,6 +1018,12 @@ pub async fn create_table(configuration: &configuration::Configuration, id: &str if let Some(ref param_value) = p_mode { req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_properties { + req_builder = req_builder.query(&[("properties", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_storage_options { + req_builder = req_builder.query(&[("storage_options", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/rust/lance-namespace-reqwest-client/src/models/create_empty_table_request.rs b/rust/lance-namespace-reqwest-client/src/models/create_empty_table_request.rs deleted file mode 100644 index d26a097fc..000000000 --- a/rust/lance-namespace-reqwest-client/src/models/create_empty_table_request.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Lance Namespace Specification - * - * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateEmptyTableRequest : Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateEmptyTableRequest { - #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] - pub identity: Option>, - /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-: `. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`. - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option>, - /// Optional storage location for the table. If not provided, the namespace implementation should determine the table location. - #[serde(rename = "location", skip_serializing_if = "Option::is_none")] - pub location: Option, - /// Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. - #[serde(rename = "vend_credentials", skip_serializing_if = "Option::is_none")] - pub vend_credentials: Option, - /// Properties stored on the table, if supported by the server. - #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] - pub properties: Option>, -} - -impl CreateEmptyTableRequest { - /// Request for creating an empty table. **Deprecated**: Use `DeclareTableRequest` instead. - pub fn new() -> CreateEmptyTableRequest { - CreateEmptyTableRequest { - identity: None, - context: None, - id: None, - location: None, - vend_credentials: None, - properties: None, - } - } -} - diff --git a/rust/lance-namespace-reqwest-client/src/models/create_empty_table_response.rs b/rust/lance-namespace-reqwest-client/src/models/create_empty_table_response.rs deleted file mode 100644 index fd20047d4..000000000 --- a/rust/lance-namespace-reqwest-client/src/models/create_empty_table_response.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Lance Namespace Specification - * - * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateEmptyTableResponse : Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateEmptyTableResponse { - /// Optional transaction identifier - #[serde(rename = "transaction_id", skip_serializing_if = "Option::is_none")] - pub transaction_id: Option, - #[serde(rename = "location", skip_serializing_if = "Option::is_none")] - pub location: Option, - /// Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. - #[serde(rename = "storage_options", skip_serializing_if = "Option::is_none")] - pub storage_options: Option>, - /// If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. - #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] - pub properties: Option>, -} - -impl CreateEmptyTableResponse { - /// Response for creating an empty table. **Deprecated**: Use `DeclareTableResponse` instead. - pub fn new() -> CreateEmptyTableResponse { - CreateEmptyTableResponse { - transaction_id: None, - location: None, - storage_options: None, - properties: None, - } - } -} - diff --git a/rust/lance-namespace-reqwest-client/src/models/create_table_request.rs b/rust/lance-namespace-reqwest-client/src/models/create_table_request.rs index 812f46199..8d97d651f 100644 --- a/rust/lance-namespace-reqwest-client/src/models/create_table_request.rs +++ b/rust/lance-namespace-reqwest-client/src/models/create_table_request.rs @@ -11,7 +11,7 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// CreateTableRequest : Request for creating a table, excluding the Arrow IPC stream. +/// CreateTableRequest : Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateTableRequest { #[serde(rename = "identity", skip_serializing_if = "Option::is_none")] @@ -24,13 +24,16 @@ pub struct CreateTableRequest { /// There are three modes when trying to create a table, to differentiate the behavior when a table of the same name already exists. Case insensitive, supports both PascalCase and snake_case. Valid values are: * Create: the operation fails with 409. * ExistOk: the operation succeeds and the existing table is kept. * Overwrite: the existing table is dropped and a new table with this name is created. #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] pub mode: Option, - /// Properties stored on the table, if supported by the implementation. + /// Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] pub properties: Option>, + /// Storage options that configure overrides for writing table data and metadata during table creation. These are passed to Lance for the write path. + #[serde(rename = "storage_options", skip_serializing_if = "Option::is_none")] + pub storage_options: Option>, } impl CreateTableRequest { - /// Request for creating a table, excluding the Arrow IPC stream. + /// Request for creating a table, excluding the Arrow IPC stream. The table location and any credential vending behavior are determined by the implementation and returned in the response, rather than specified in this request. pub fn new() -> CreateTableRequest { CreateTableRequest { identity: None, @@ -38,6 +41,7 @@ impl CreateTableRequest { id: None, mode: None, properties: None, + storage_options: None, } } } diff --git a/rust/lance-namespace-reqwest-client/src/models/create_table_response.rs b/rust/lance-namespace-reqwest-client/src/models/create_table_response.rs index 377d2f159..543091de8 100644 --- a/rust/lance-namespace-reqwest-client/src/models/create_table_response.rs +++ b/rust/lance-namespace-reqwest-client/src/models/create_table_response.rs @@ -23,7 +23,7 @@ pub struct CreateTableResponse { /// Configuration options to be used to access storage. The available options depend on the type of storage in use. These will be passed directly to Lance to initialize storage access. #[serde(rename = "storage_options", skip_serializing_if = "Option::is_none")] pub storage_options: Option>, - /// If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties. + /// Business logic properties stored and managed by the namespace implementation outside Lance context. If the implementation does not support table properties, it should return null for this field. #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] pub properties: Option>, } diff --git a/rust/lance-namespace-reqwest-client/src/models/declare_table_request.rs b/rust/lance-namespace-reqwest-client/src/models/declare_table_request.rs index 61682a922..fc1cbf134 100644 --- a/rust/lance-namespace-reqwest-client/src/models/declare_table_request.rs +++ b/rust/lance-namespace-reqwest-client/src/models/declare_table_request.rs @@ -27,7 +27,7 @@ pub struct DeclareTableRequest { /// Whether to include vended credentials in the response `storage_options`. When true, the implementation should provide vended credentials for accessing storage. When not set, the implementation can decide whether to return vended credentials. #[serde(rename = "vend_credentials", skip_serializing_if = "Option::is_none")] pub vend_credentials: Option, - /// Properties stored on the table, if supported by the server. + /// Business logic properties stored and managed by the namespace implementation outside Lance context, if supported by the implementation. #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] pub properties: Option>, } diff --git a/rust/lance-namespace-reqwest-client/src/models/mod.rs b/rust/lance-namespace-reqwest-client/src/models/mod.rs index d43e34439..f4f7d6812 100644 --- a/rust/lance-namespace-reqwest-client/src/models/mod.rs +++ b/rust/lance-namespace-reqwest-client/src/models/mod.rs @@ -54,10 +54,6 @@ pub mod commit_table_result; pub use self::commit_table_result::CommitTableResult; pub mod count_table_rows_request; pub use self::count_table_rows_request::CountTableRowsRequest; -pub mod create_empty_table_request; -pub use self::create_empty_table_request::CreateEmptyTableRequest; -pub mod create_empty_table_response; -pub use self::create_empty_table_response::CreateEmptyTableResponse; pub mod create_namespace_request; pub use self::create_namespace_request::CreateNamespaceRequest; pub mod create_namespace_response;