diff --git a/java/lance-catalog-apache-client/.openapi-generator/FILES b/java/lance-catalog-apache-client/.openapi-generator/FILES
index cb4eaff9..ea6a9320 100644
--- a/java/lance-catalog-apache-client/.openapi-generator/FILES
+++ b/java/lance-catalog-apache-client/.openapi-generator/FILES
@@ -3,13 +3,17 @@ README.md
api/openapi.yaml
docs/CreateNamespaceRequest.md
docs/CreateNamespaceResponse.md
+docs/CreateTableRequest.md
docs/ErrorResponse.md
+docs/Field.md
docs/GetNamespaceResponse.md
docs/GetTableResponse.md
docs/ListNamespacesResponse.md
docs/NamespaceApi.md
docs/RegisterTableRequest.md
+docs/Schema.md
docs/TableApi.md
+docs/WriterVersion.md
pom.xml
src/main/AndroidManifest.xml
src/main/java/com/lancedb/lance/catalog/client/apache/ApiClient.java
@@ -30,8 +34,12 @@ src/main/java/com/lancedb/lance/catalog/client/apache/auth/HttpBasicAuth.java
src/main/java/com/lancedb/lance/catalog/client/apache/auth/HttpBearerAuth.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateNamespaceRequest.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateNamespaceResponse.java
+src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateTableRequest.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/ErrorResponse.java
+src/main/java/com/lancedb/lance/catalog/client/apache/model/Field.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/GetNamespaceResponse.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/GetTableResponse.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/ListNamespacesResponse.java
src/main/java/com/lancedb/lance/catalog/client/apache/model/RegisterTableRequest.java
+src/main/java/com/lancedb/lance/catalog/client/apache/model/Schema.java
+src/main/java/com/lancedb/lance/catalog/client/apache/model/WriterVersion.java
diff --git a/java/lance-catalog-apache-client/README.md b/java/lance-catalog-apache-client/README.md
index 52c006f1..4356cbcc 100644
--- a/java/lance-catalog-apache-client/README.md
+++ b/java/lance-catalog-apache-client/README.md
@@ -119,6 +119,7 @@ Class | Method | HTTP request | Description
*NamespaceApi* | [**getNamespace**](docs/NamespaceApi.md#getNamespace) | **GET** /v1/namespaces/{ns} | Get information about a namespace
*NamespaceApi* | [**listNamespaces**](docs/NamespaceApi.md#listNamespaces) | **GET** /v1/namespaces | List all namespaces in the catalog.
*NamespaceApi* | [**namespaceExists**](docs/NamespaceApi.md#namespaceExists) | **HEAD** /v1/namespaces/{ns} | Check if a namespace exists
+*TableApi* | [**createTable**](docs/TableApi.md#createTable) | **POST** /v1/namespaces/{ns}/tables | Create a table in the catalog
*TableApi* | [**getTable**](docs/TableApi.md#getTable) | **GET** /v1/namespaces/{ns}/tables/{table} | Get a table from the catalog
*TableApi* | [**registerTable**](docs/TableApi.md#registerTable) | **POST** /v1/namespaces/{ns}/register | Register a new table in the given namespace. A table represents a lance dataset. In Lance catalog, a table must be hosted in a namespace.
*TableApi* | [**tableExists**](docs/TableApi.md#tableExists) | **HEAD** /v1/namespaces/{ns}/tables/{table} | Check if a table exists
@@ -128,11 +129,15 @@ Class | Method | HTTP request | Description
- [CreateNamespaceRequest](docs/CreateNamespaceRequest.md)
- [CreateNamespaceResponse](docs/CreateNamespaceResponse.md)
+ - [CreateTableRequest](docs/CreateTableRequest.md)
- [ErrorResponse](docs/ErrorResponse.md)
+ - [Field](docs/Field.md)
- [GetNamespaceResponse](docs/GetNamespaceResponse.md)
- [GetTableResponse](docs/GetTableResponse.md)
- [ListNamespacesResponse](docs/ListNamespacesResponse.md)
- [RegisterTableRequest](docs/RegisterTableRequest.md)
+ - [Schema](docs/Schema.md)
+ - [WriterVersion](docs/WriterVersion.md)
diff --git a/java/lance-catalog-apache-client/api/openapi.yaml b/java/lance-catalog-apache-client/api/openapi.yaml
index 9e27bd71..18a90218 100644
--- a/java/lance-catalog-apache-client/api/openapi.yaml
+++ b/java/lance-catalog-apache-client/api/openapi.yaml
@@ -213,6 +213,46 @@ paths:
x-content-type: application/json
x-accepts:
- application/json
+ /v1/namespaces/{ns}/tables:
+ parameters:
+ - $ref: '#/components/parameters/namespace'
+ post:
+ description: |
+ Create a new Lance table in the catalog.
+ There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created.
+ The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+ operationId: CreateTable
+ parameters:
+ - $ref: '#/components/parameters/namespace'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateTableRequest'
+ required: true
+ responses:
+ "200":
+ $ref: '#/components/responses/GetTableResponse'
+ "400":
+ $ref: '#/components/responses/BadRequestErrorResponse'
+ "401":
+ $ref: '#/components/responses/UnauthorizedErrorResponse'
+ "403":
+ $ref: '#/components/responses/ForbiddenErrorResponse'
+ "406":
+ $ref: '#/components/responses/UnsupportedOperationErrorResponse'
+ "409":
+ $ref: '#/components/responses/ConflictErrorResponse'
+ "503":
+ $ref: '#/components/responses/ServiceUnavailableErrorResponse'
+ "5XX":
+ $ref: '#/components/responses/ServerErrorResponse'
+ summary: Create a table in the catalog
+ tags:
+ - Table
+ x-content-type: application/json
+ x-accepts:
+ - application/json
/v1/namespaces/{ns}/tables/{table}:
get:
description: Get a table's detailed information under a specified namespace
@@ -605,6 +645,153 @@ components:
required:
- location
- name
+ Schema:
+ example:
+ metadata:
+ key: metadata
+ fields:
+ - metadata:
+ key: metadata
+ logicalType: logicalType
+ nullable: true
+ name: name
+ id: ""
+ type: PARENT
+ parentId: ""
+ - metadata:
+ key: metadata
+ logicalType: logicalType
+ nullable: true
+ name: name
+ id: ""
+ type: PARENT
+ parentId: ""
+ properties:
+ metadata:
+ additionalProperties:
+ type: string
+ fields:
+ items:
+ $ref: '#/components/schemas/Field'
+ type: array
+ uniqueItems: true
+ required:
+ - fields
+ Field:
+ example:
+ metadata:
+ key: metadata
+ logicalType: logicalType
+ nullable: true
+ name: name
+ id: ""
+ type: PARENT
+ parentId: ""
+ properties:
+ type:
+ enum:
+ - PARENT
+ - REPEATED
+ - LEAF
+ type: string
+ name:
+ type: string
+ id:
+ type: int
+ parentId:
+ type: int
+ logicalType:
+ description: |
+ Logical types, currently support parameterized Arrow Type.
+ PARENT types will always have logical type "struct".
+ Logical type "map" is represented as a struct with a single child field "entries". "entries" is a struct with fields "key" and "value".
+ REPEATED types may have logical types: * "list" * "large_list" * "list.struct" * "large_list.struct" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT.
+ LEAF types may have logical types: * "null" * "bool" * "int8" / "uint8" * "int16" / "uint16" * "int32" / "uint32" * "int64" / "uint64" * "halffloat" / "float" / "double" * "string" / "large_string" * "binary" / "large_binary" * "date32:day" * "date64:ms" * "decimal:128:{precision}:{scale}" / "decimal:256:{precision}:{scale}" * "time:{unit}" / "timestamp:{unit}" / "duration:{unit}", where unit is "s", "ms", "us", "ns" * "dict:{value_type}:{index_type}:false"
+ type: string
+ nullable:
+ type: boolean
+ metadata:
+ additionalProperties:
+ type: string
+ description: optional field metadata (e.g. extension type name/parameters)
+ required:
+ - id
+ - logicalType
+ - name
+ - type
+ WriterVersion:
+ example:
+ library: library
+ version: version
+ properties:
+ library:
+ description: The name of the library that created this file.
+ type: string
+ version:
+ description: |
+ The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`.
+ type: string
+ CreateTableRequest:
+ example:
+ mode: CREATE
+ schema:
+ metadata:
+ key: metadata
+ fields:
+ - metadata:
+ key: metadata
+ logicalType: logicalType
+ nullable: true
+ name: name
+ id: ""
+ type: PARENT
+ parentId: ""
+ - metadata:
+ key: metadata
+ logicalType: logicalType
+ nullable: true
+ name: name
+ id: ""
+ type: PARENT
+ parentId: ""
+ name: name
+ location: location
+ type: STORAGE_MANAGED
+ config:
+ key: config
+ writerVersion:
+ library: library
+ version: version
+ properties:
+ name:
+ type: string
+ mode:
+ default: CREATE
+ enum:
+ - CREATE
+ - EXIST_OK
+ - OVERWRITE
+ type: string
+ type:
+ default: STORAGE_MANAGED
+ enum:
+ - STORAGE_MANAGED
+ - CATALOG_MANAGED
+ type: string
+ location:
+ type: string
+ schema:
+ $ref: '#/components/schemas/Schema'
+ writerVersion:
+ $ref: '#/components/schemas/WriterVersion'
+ config:
+ additionalProperties:
+ type: string
+ description: |
+ optional configurations for the table. Keys with the prefix "lance." are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately.
+ required:
+ - name
+ - schema
GetTableResponse:
description: |
Result used when a table is successfully loaded.
diff --git a/java/lance-catalog-apache-client/docs/CreateTableRequest.md b/java/lance-catalog-apache-client/docs/CreateTableRequest.md
new file mode 100644
index 00000000..1e17d0b6
--- /dev/null
+++ b/java/lance-catalog-apache-client/docs/CreateTableRequest.md
@@ -0,0 +1,38 @@
+
+
+# CreateTableRequest
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**name** | **String** | | |
+|**mode** | [**ModeEnum**](#ModeEnum) | | [optional] |
+|**type** | [**TypeEnum**](#TypeEnum) | | [optional] |
+|**location** | **String** | | [optional] |
+|**schema** | [**Schema**](Schema.md) | | |
+|**writerVersion** | [**WriterVersion**](WriterVersion.md) | | [optional] |
+|**config** | **Map<String, String>** | optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately. | [optional] |
+
+
+
+## Enum: ModeEnum
+
+| Name | Value |
+|---- | -----|
+| CREATE | "CREATE" |
+| EXIST_OK | "EXIST_OK" |
+| OVERWRITE | "OVERWRITE" |
+
+
+
+## Enum: TypeEnum
+
+| Name | Value |
+|---- | -----|
+| STORAGE_MANAGED | "STORAGE_MANAGED" |
+| CATALOG_MANAGED | "CATALOG_MANAGED" |
+
+
+
diff --git a/java/lance-catalog-apache-client/docs/Field.md b/java/lance-catalog-apache-client/docs/Field.md
new file mode 100644
index 00000000..9ac9c9c3
--- /dev/null
+++ b/java/lance-catalog-apache-client/docs/Field.md
@@ -0,0 +1,29 @@
+
+
+# Field
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**type** | [**TypeEnum**](#TypeEnum) | | |
+|**name** | **String** | | |
+|**id** | **Integer** | | |
+|**parentId** | **Integer** | | [optional] |
+|**logicalType** | **String** | Logical types, currently support parameterized Arrow Type. PARENT types will always have logical type \"struct\". Logical type \"map\" is represented as a struct with a single child field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" / \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" * \"dict:{value_type}:{index_type}:false\" | |
+|**nullable** | **Boolean** | | [optional] |
+|**metadata** | **Map<String, String>** | optional field metadata (e.g. extension type name/parameters) | [optional] |
+
+
+
+## Enum: TypeEnum
+
+| Name | Value |
+|---- | -----|
+| PARENT | "PARENT" |
+| REPEATED | "REPEATED" |
+| LEAF | "LEAF" |
+
+
+
diff --git a/java/lance-catalog-apache-client/docs/Schema.md b/java/lance-catalog-apache-client/docs/Schema.md
new file mode 100644
index 00000000..9e83e4c8
--- /dev/null
+++ b/java/lance-catalog-apache-client/docs/Schema.md
@@ -0,0 +1,14 @@
+
+
+# Schema
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**metadata** | **Map<String, String>** | | [optional] |
+|**fields** | [**Set<Field>**](Field.md) | | |
+
+
+
diff --git a/java/lance-catalog-apache-client/docs/TableApi.md b/java/lance-catalog-apache-client/docs/TableApi.md
index 0b225800..2594d7cc 100644
--- a/java/lance-catalog-apache-client/docs/TableApi.md
+++ b/java/lance-catalog-apache-client/docs/TableApi.md
@@ -4,12 +4,88 @@ All URIs are relative to *http://localhost:2333*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
+| [**createTable**](TableApi.md#createTable) | **POST** /v1/namespaces/{ns}/tables | Create a table in the catalog |
| [**getTable**](TableApi.md#getTable) | **GET** /v1/namespaces/{ns}/tables/{table} | Get a table from the catalog |
| [**registerTable**](TableApi.md#registerTable) | **POST** /v1/namespaces/{ns}/register | Register a new table in the given namespace. A table represents a lance dataset. In Lance catalog, a table must be hosted in a namespace. |
| [**tableExists**](TableApi.md#tableExists) | **HEAD** /v1/namespaces/{ns}/tables/{table} | Check if a table exists |
+## createTable
+
+> GetTableResponse createTable(ns, createTableRequest)
+
+Create a table in the catalog
+
+Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+
+### Example
+
+```java
+// Import classes:
+import com.lancedb.lance.catalog.client.apache.ApiClient;
+import com.lancedb.lance.catalog.client.apache.ApiException;
+import com.lancedb.lance.catalog.client.apache.Configuration;
+import com.lancedb.lance.catalog.client.apache.models.*;
+import com.lancedb.lance.catalog.client.apache.api.TableApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://localhost:2333");
+
+ TableApi apiInstance = new TableApi(defaultClient);
+ String ns = "ns_example"; // String | The name of the namespace.
+ CreateTableRequest createTableRequest = new CreateTableRequest(); // CreateTableRequest |
+ try {
+ GetTableResponse result = apiInstance.createTable(ns, createTableRequest);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling TableApi#createTable");
+ 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 |
+|------------- | ------------- | ------------- | -------------|
+| **ns** | **String**| The name of the namespace. | |
+| **createTableRequest** | [**CreateTableRequest**](CreateTableRequest.md)| | |
+
+### Return type
+
+[**GetTableResponse**](GetTableResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Table properties result when loading a 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. | - |
+| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - |
+| **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. | - |
+
+
## getTable
> GetTableResponse getTable(ns, table)
diff --git a/java/lance-catalog-apache-client/docs/WriterVersion.md b/java/lance-catalog-apache-client/docs/WriterVersion.md
new file mode 100644
index 00000000..c2a858ba
--- /dev/null
+++ b/java/lance-catalog-apache-client/docs/WriterVersion.md
@@ -0,0 +1,14 @@
+
+
+# WriterVersion
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**library** | **String** | The name of the library that created this file. | [optional] |
+|**version** | **String** | The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`. | [optional] |
+
+
+
diff --git a/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/api/TableApi.java b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/api/TableApi.java
index b04755d2..ad34bfc2 100644
--- a/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/api/TableApi.java
+++ b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/api/TableApi.java
@@ -18,6 +18,7 @@
import com.lancedb.lance.catalog.client.apache.BaseApi;
import com.lancedb.lance.catalog.client.apache.Configuration;
import com.lancedb.lance.catalog.client.apache.Pair;
+import com.lancedb.lance.catalog.client.apache.model.CreateTableRequest;
import com.lancedb.lance.catalog.client.apache.model.GetTableResponse;
import com.lancedb.lance.catalog.client.apache.model.RegisterTableRequest;
@@ -43,6 +44,103 @@ public TableApi(ApiClient apiClient) {
super(apiClient);
}
+ /**
+ * Create a table in the catalog Create a new Lance table in the catalog. There are three modes
+ * when trying to create a table: * CREATE: Create the table if it does not exist. If a table of
+ * the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it
+ * does not exist. If a table of the same name already exists, the operation succeeds and the
+ * existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the
+ * same name already exists, the existing table and all data is dropped and a new table with this
+ * name with no data is created. The server might create the table using a library and writer
+ * version that is different from the one in the user environment. The server is responsible for
+ * rejecting the request if the table created by the server cannot be properly used by the client
+ * library and writer version.
+ *
+ * @param ns The name of the namespace. (required)
+ * @param createTableRequest (required)
+ * @return GetTableResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GetTableResponse createTable(String ns, CreateTableRequest createTableRequest)
+ throws ApiException {
+ return this.createTable(ns, createTableRequest, Collections.emptyMap());
+ }
+
+ /**
+ * Create a table in the catalog Create a new Lance table in the catalog. There are three modes
+ * when trying to create a table: * CREATE: Create the table if it does not exist. If a table of
+ * the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it
+ * does not exist. If a table of the same name already exists, the operation succeeds and the
+ * existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the
+ * same name already exists, the existing table and all data is dropped and a new table with this
+ * name with no data is created. The server might create the table using a library and writer
+ * version that is different from the one in the user environment. The server is responsible for
+ * rejecting the request if the table created by the server cannot be properly used by the client
+ * library and writer version.
+ *
+ * @param ns The name of the namespace. (required)
+ * @param createTableRequest (required)
+ * @param additionalHeaders additionalHeaders for this call
+ * @return GetTableResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GetTableResponse createTable(
+ String ns, CreateTableRequest createTableRequest, Map additionalHeaders)
+ throws ApiException {
+ Object localVarPostBody = createTableRequest;
+
+ // verify the required parameter 'ns' is set
+ if (ns == null) {
+ throw new ApiException(400, "Missing the required parameter 'ns' when calling createTable");
+ }
+
+ // verify the required parameter 'createTableRequest' is set
+ if (createTableRequest == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'createTableRequest' when calling createTable");
+ }
+
+ // create path and map variables
+ String localVarPath =
+ "/v1/namespaces/{ns}/tables"
+ .replaceAll(
+ "\\{" + "ns" + "\\}", apiClient.escapeString(apiClient.parameterToString(ns)));
+
+ 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();
+
+ 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[] {};
+
+ TypeReference localVarReturnType = new TypeReference() {};
+ return apiClient.invokeAPI(
+ localVarPath,
+ "POST",
+ localVarQueryParams,
+ localVarCollectionQueryParams,
+ localVarQueryStringJoiner.toString(),
+ localVarPostBody,
+ localVarHeaderParams,
+ localVarCookieParams,
+ localVarFormParams,
+ localVarAccept,
+ localVarContentType,
+ localVarAuthNames,
+ localVarReturnType);
+ }
+
/**
* Get a table from the catalog Get a table's detailed information under a specified namespace
* from the catalog.
diff --git a/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateTableRequest.java b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateTableRequest.java
new file mode 100644
index 00000000..f09f367f
--- /dev/null
+++ b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateTableRequest.java
@@ -0,0 +1,488 @@
+/*
+ * 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 com.lancedb.lance.catalog.client.apache.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.StringJoiner;
+
+/** CreateTableRequest */
+@JsonPropertyOrder({
+ CreateTableRequest.JSON_PROPERTY_NAME,
+ CreateTableRequest.JSON_PROPERTY_MODE,
+ CreateTableRequest.JSON_PROPERTY_TYPE,
+ CreateTableRequest.JSON_PROPERTY_LOCATION,
+ CreateTableRequest.JSON_PROPERTY_SCHEMA,
+ CreateTableRequest.JSON_PROPERTY_WRITER_VERSION,
+ CreateTableRequest.JSON_PROPERTY_CONFIG
+})
+@javax.annotation.Generated(
+ value = "org.openapitools.codegen.languages.JavaClientCodegen",
+ comments = "Generator version: 7.12.0")
+public class CreateTableRequest {
+ public static final String JSON_PROPERTY_NAME = "name";
+ @javax.annotation.Nonnull private String name;
+
+ /** Gets or Sets mode */
+ public enum ModeEnum {
+ CREATE(String.valueOf("CREATE")),
+
+ EXIST_OK(String.valueOf("EXIST_OK")),
+
+ OVERWRITE(String.valueOf("OVERWRITE"));
+
+ private String value;
+
+ ModeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static ModeEnum fromValue(String value) {
+ for (ModeEnum b : ModeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ public static final String JSON_PROPERTY_MODE = "mode";
+ @javax.annotation.Nullable private ModeEnum mode = ModeEnum.CREATE;
+
+ /** Gets or Sets type */
+ public enum TypeEnum {
+ STORAGE_MANAGED(String.valueOf("STORAGE_MANAGED")),
+
+ CATALOG_MANAGED(String.valueOf("CATALOG_MANAGED"));
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ @javax.annotation.Nullable private TypeEnum type = TypeEnum.STORAGE_MANAGED;
+
+ public static final String JSON_PROPERTY_LOCATION = "location";
+ @javax.annotation.Nullable private String location;
+
+ public static final String JSON_PROPERTY_SCHEMA = "schema";
+ @javax.annotation.Nonnull private Schema schema;
+
+ public static final String JSON_PROPERTY_WRITER_VERSION = "writerVersion";
+ @javax.annotation.Nullable private WriterVersion writerVersion;
+
+ public static final String JSON_PROPERTY_CONFIG = "config";
+ @javax.annotation.Nullable private Map config = new HashMap<>();
+
+ public CreateTableRequest() {}
+
+ public CreateTableRequest name(@javax.annotation.Nonnull String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ *
+ * @return name
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setName(@javax.annotation.Nonnull String name) {
+ this.name = name;
+ }
+
+ public CreateTableRequest mode(@javax.annotation.Nullable ModeEnum mode) {
+
+ this.mode = mode;
+ return this;
+ }
+
+ /**
+ * Get mode
+ *
+ * @return mode
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_MODE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public ModeEnum getMode() {
+ return mode;
+ }
+
+ @JsonProperty(JSON_PROPERTY_MODE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMode(@javax.annotation.Nullable ModeEnum mode) {
+ this.mode = mode;
+ }
+
+ public CreateTableRequest type(@javax.annotation.Nullable TypeEnum type) {
+
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ *
+ * @return type
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public TypeEnum getType() {
+ return type;
+ }
+
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setType(@javax.annotation.Nullable TypeEnum type) {
+ this.type = type;
+ }
+
+ public CreateTableRequest 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 CreateTableRequest schema(@javax.annotation.Nonnull Schema schema) {
+
+ this.schema = schema;
+ return this;
+ }
+
+ /**
+ * Get schema
+ *
+ * @return schema
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_SCHEMA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Schema getSchema() {
+ return schema;
+ }
+
+ @JsonProperty(JSON_PROPERTY_SCHEMA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setSchema(@javax.annotation.Nonnull Schema schema) {
+ this.schema = schema;
+ }
+
+ public CreateTableRequest writerVersion(@javax.annotation.Nullable WriterVersion writerVersion) {
+
+ this.writerVersion = writerVersion;
+ return this;
+ }
+
+ /**
+ * Get writerVersion
+ *
+ * @return writerVersion
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_WRITER_VERSION)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public WriterVersion getWriterVersion() {
+ return writerVersion;
+ }
+
+ @JsonProperty(JSON_PROPERTY_WRITER_VERSION)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setWriterVersion(@javax.annotation.Nullable WriterVersion writerVersion) {
+ this.writerVersion = writerVersion;
+ }
+
+ public CreateTableRequest config(@javax.annotation.Nullable Map config) {
+
+ this.config = config;
+ return this;
+ }
+
+ public CreateTableRequest putConfigItem(String key, String configItem) {
+ if (this.config == null) {
+ this.config = new HashMap<>();
+ }
+ this.config.put(key, configItem);
+ return this;
+ }
+
+ /**
+ * optional configurations for the table. Keys with the prefix \"lance.\" are reserved
+ * for the Lance library. Other libraries may wish to similarly prefix their configuration keys
+ * appropriately.
+ *
+ * @return config
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_CONFIG)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getConfig() {
+ return config;
+ }
+
+ @JsonProperty(JSON_PROPERTY_CONFIG)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setConfig(@javax.annotation.Nullable Map config) {
+ this.config = config;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateTableRequest createTableRequest = (CreateTableRequest) o;
+ return Objects.equals(this.name, createTableRequest.name)
+ && Objects.equals(this.mode, createTableRequest.mode)
+ && Objects.equals(this.type, createTableRequest.type)
+ && Objects.equals(this.location, createTableRequest.location)
+ && Objects.equals(this.schema, createTableRequest.schema)
+ && Objects.equals(this.writerVersion, createTableRequest.writerVersion)
+ && Objects.equals(this.config, createTableRequest.config);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, mode, type, location, schema, writerVersion, config);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateTableRequest {\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" mode: ").append(toIndentedString(mode)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" location: ").append(toIndentedString(location)).append("\n");
+ sb.append(" schema: ").append(toIndentedString(schema)).append("\n");
+ sb.append(" writerVersion: ").append(toIndentedString(writerVersion)).append("\n");
+ sb.append(" config: ").append(toIndentedString(config)).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 `name` to the URL query string
+ if (getName() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%sname%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `mode` to the URL query string
+ if (getMode() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%smode%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getMode()), "UTF-8").replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `type` to the URL query string
+ if (getType() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%stype%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getType()), "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 `schema` to the URL query string
+ if (getSchema() != null) {
+ joiner.add(getSchema().toUrlQueryString(prefix + "schema" + suffix));
+ }
+
+ // add `writerVersion` to the URL query string
+ if (getWriterVersion() != null) {
+ joiner.add(getWriterVersion().toUrlQueryString(prefix + "writerVersion" + suffix));
+ }
+
+ // add `config` to the URL query string
+ if (getConfig() != null) {
+ for (String _key : getConfig().keySet()) {
+ try {
+ joiner.add(
+ String.format(
+ "%sconfig%s%s=%s",
+ prefix,
+ suffix,
+ "".equals(suffix)
+ ? ""
+ : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
+ getConfig().get(_key),
+ URLEncoder.encode(String.valueOf(getConfig().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-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/Field.java b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/Field.java
new file mode 100644
index 00000000..ef3c54da
--- /dev/null
+++ b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/Field.java
@@ -0,0 +1,489 @@
+/*
+ * 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 com.lancedb.lance.catalog.client.apache.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.StringJoiner;
+
+/** Field */
+@JsonPropertyOrder({
+ Field.JSON_PROPERTY_TYPE,
+ Field.JSON_PROPERTY_NAME,
+ Field.JSON_PROPERTY_ID,
+ Field.JSON_PROPERTY_PARENT_ID,
+ Field.JSON_PROPERTY_LOGICAL_TYPE,
+ Field.JSON_PROPERTY_NULLABLE,
+ Field.JSON_PROPERTY_METADATA
+})
+@javax.annotation.Generated(
+ value = "org.openapitools.codegen.languages.JavaClientCodegen",
+ comments = "Generator version: 7.12.0")
+public class Field {
+ /** Gets or Sets type */
+ public enum TypeEnum {
+ PARENT(String.valueOf("PARENT")),
+
+ REPEATED(String.valueOf("REPEATED")),
+
+ LEAF(String.valueOf("LEAF"));
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ @javax.annotation.Nonnull private TypeEnum type;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ @javax.annotation.Nonnull private String name;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ @javax.annotation.Nonnull private Integer id = null;
+
+ public static final String JSON_PROPERTY_PARENT_ID = "parentId";
+ @javax.annotation.Nullable private Integer parentId = null;
+
+ public static final String JSON_PROPERTY_LOGICAL_TYPE = "logicalType";
+ @javax.annotation.Nonnull private String logicalType;
+
+ public static final String JSON_PROPERTY_NULLABLE = "nullable";
+ @javax.annotation.Nullable private Boolean nullable;
+
+ public static final String JSON_PROPERTY_METADATA = "metadata";
+ @javax.annotation.Nullable private Map metadata = new HashMap<>();
+
+ public Field() {}
+
+ public Field type(@javax.annotation.Nonnull TypeEnum type) {
+
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ *
+ * @return type
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TypeEnum getType() {
+ return type;
+ }
+
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setType(@javax.annotation.Nonnull TypeEnum type) {
+ this.type = type;
+ }
+
+ public Field name(@javax.annotation.Nonnull String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ *
+ * @return name
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getName() {
+ return name;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setName(@javax.annotation.Nonnull String name) {
+ this.name = name;
+ }
+
+ public Field id(@javax.annotation.Nonnull Integer id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ *
+ * @return id
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Integer getId() {
+ return id;
+ }
+
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setId(@javax.annotation.Nonnull Integer id) {
+ this.id = id;
+ }
+
+ public Field parentId(@javax.annotation.Nullable Integer parentId) {
+
+ this.parentId = parentId;
+ return this;
+ }
+
+ /**
+ * Get parentId
+ *
+ * @return parentId
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_PARENT_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Integer getParentId() {
+ return parentId;
+ }
+
+ @JsonProperty(JSON_PROPERTY_PARENT_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setParentId(@javax.annotation.Nullable Integer parentId) {
+ this.parentId = parentId;
+ }
+
+ public Field logicalType(@javax.annotation.Nonnull String logicalType) {
+
+ this.logicalType = logicalType;
+ return this;
+ }
+
+ /**
+ * Logical types, currently support parameterized Arrow Type. PARENT types will always have
+ * logical type \"struct\". Logical type \"map\" is represented as a struct
+ * with a single child field \"entries\". \"entries\" is a struct with fields
+ * \"key\" and \"value\". REPEATED types may have logical types: *
+ * \"list\" * \"large_list\" * \"list.struct\" *
+ * \"large_list.struct\" The final two are used if the list values are structs, and
+ * therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types:
+ * * \"null\" * \"bool\" * \"int8\" / \"uint8\" *
+ * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" *
+ * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" /
+ * \"double\" * \"string\" / \"large_string\" * \"binary\"
+ * / \"large_binary\" * \"date32:day\" * \"date64:ms\" *
+ * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" *
+ * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\",
+ * where unit is \"s\", \"ms\", \"us\", \"ns\" *
+ * \"dict:{value_type}:{index_type}:false\"
+ *
+ * @return logicalType
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_LOGICAL_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getLogicalType() {
+ return logicalType;
+ }
+
+ @JsonProperty(JSON_PROPERTY_LOGICAL_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setLogicalType(@javax.annotation.Nonnull String logicalType) {
+ this.logicalType = logicalType;
+ }
+
+ public Field nullable(@javax.annotation.Nullable Boolean nullable) {
+
+ this.nullable = nullable;
+ return this;
+ }
+
+ /**
+ * Get nullable
+ *
+ * @return nullable
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_NULLABLE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ @JsonProperty(JSON_PROPERTY_NULLABLE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setNullable(@javax.annotation.Nullable Boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ public Field metadata(@javax.annotation.Nullable Map metadata) {
+
+ this.metadata = metadata;
+ return this;
+ }
+
+ public Field putMetadataItem(String key, String metadataItem) {
+ if (this.metadata == null) {
+ this.metadata = new HashMap<>();
+ }
+ this.metadata.put(key, metadataItem);
+ return this;
+ }
+
+ /**
+ * optional field metadata (e.g. extension type name/parameters)
+ *
+ * @return metadata
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_METADATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ @JsonProperty(JSON_PROPERTY_METADATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMetadata(@javax.annotation.Nullable Map metadata) {
+ this.metadata = metadata;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Field field = (Field) o;
+ return Objects.equals(this.type, field.type)
+ && Objects.equals(this.name, field.name)
+ && Objects.equals(this.id, field.id)
+ && Objects.equals(this.parentId, field.parentId)
+ && Objects.equals(this.logicalType, field.logicalType)
+ && Objects.equals(this.nullable, field.nullable)
+ && Objects.equals(this.metadata, field.metadata);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, name, id, parentId, logicalType, nullable, metadata);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Field {\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n");
+ sb.append(" logicalType: ").append(toIndentedString(logicalType)).append("\n");
+ sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n");
+ sb.append(" metadata: ").append(toIndentedString(metadata)).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 `type` to the URL query string
+ if (getType() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%stype%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `name` to the URL query string
+ if (getName() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%sname%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getName()), "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) {
+ try {
+ joiner.add(
+ String.format(
+ "%sid%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `parentId` to the URL query string
+ if (getParentId() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%sparentId%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getParentId()), "UTF-8")
+ .replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `logicalType` to the URL query string
+ if (getLogicalType() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%slogicalType%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getLogicalType()), "UTF-8")
+ .replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `nullable` to the URL query string
+ if (getNullable() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%snullable%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getNullable()), "UTF-8")
+ .replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `metadata` to the URL query string
+ if (getMetadata() != null) {
+ for (String _key : getMetadata().keySet()) {
+ try {
+ joiner.add(
+ String.format(
+ "%smetadata%s%s=%s",
+ prefix,
+ suffix,
+ "".equals(suffix)
+ ? ""
+ : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
+ getMetadata().get(_key),
+ URLEncoder.encode(String.valueOf(getMetadata().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-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/Schema.java b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/Schema.java
new file mode 100644
index 00000000..34c481cf
--- /dev/null
+++ b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/Schema.java
@@ -0,0 +1,222 @@
+/*
+ * 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 com.lancedb.lance.catalog.client.apache.model;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.StringJoiner;
+
+/** Schema */
+@JsonPropertyOrder({Schema.JSON_PROPERTY_METADATA, Schema.JSON_PROPERTY_FIELDS})
+@javax.annotation.Generated(
+ value = "org.openapitools.codegen.languages.JavaClientCodegen",
+ comments = "Generator version: 7.12.0")
+public class Schema {
+ public static final String JSON_PROPERTY_METADATA = "metadata";
+ @javax.annotation.Nullable private Map metadata = new HashMap<>();
+
+ public static final String JSON_PROPERTY_FIELDS = "fields";
+ @javax.annotation.Nonnull private Set fields = new LinkedHashSet<>();
+
+ public Schema() {}
+
+ public Schema metadata(@javax.annotation.Nullable Map metadata) {
+
+ this.metadata = metadata;
+ return this;
+ }
+
+ public Schema putMetadataItem(String key, String metadataItem) {
+ if (this.metadata == null) {
+ this.metadata = new HashMap<>();
+ }
+ this.metadata.put(key, metadataItem);
+ return this;
+ }
+
+ /**
+ * Get metadata
+ *
+ * @return metadata
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_METADATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ @JsonProperty(JSON_PROPERTY_METADATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setMetadata(@javax.annotation.Nullable Map metadata) {
+ this.metadata = metadata;
+ }
+
+ public Schema fields(@javax.annotation.Nonnull Set fields) {
+
+ this.fields = fields;
+ return this;
+ }
+
+ public Schema addFieldsItem(Field fieldsItem) {
+ if (this.fields == null) {
+ this.fields = new LinkedHashSet<>();
+ }
+ this.fields.add(fieldsItem);
+ return this;
+ }
+
+ /**
+ * Get fields
+ *
+ * @return fields
+ */
+ @javax.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_FIELDS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Set getFields() {
+ return fields;
+ }
+
+ @JsonDeserialize(as = LinkedHashSet.class)
+ @JsonProperty(JSON_PROPERTY_FIELDS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setFields(@javax.annotation.Nonnull Set fields) {
+ this.fields = fields;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Schema schema = (Schema) o;
+ return Objects.equals(this.metadata, schema.metadata)
+ && Objects.equals(this.fields, schema.fields);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(metadata, fields);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Schema {\n");
+ sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
+ sb.append(" fields: ").append(toIndentedString(fields)).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 `metadata` to the URL query string
+ if (getMetadata() != null) {
+ for (String _key : getMetadata().keySet()) {
+ try {
+ joiner.add(
+ String.format(
+ "%smetadata%s%s=%s",
+ prefix,
+ suffix,
+ "".equals(suffix)
+ ? ""
+ : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
+ getMetadata().get(_key),
+ URLEncoder.encode(String.valueOf(getMetadata().get(_key)), "UTF-8")
+ .replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ // add `fields` to the URL query string
+ if (getFields() != null) {
+ int i = 0;
+ for (Field _item : getFields()) {
+ if (_item != null) {
+ joiner.add(
+ _item.toUrlQueryString(
+ String.format(
+ "%sfields%s%s",
+ prefix,
+ suffix,
+ "".equals(suffix)
+ ? ""
+ : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
+ }
+ }
+ i++;
+ }
+
+ return joiner.toString();
+ }
+}
diff --git a/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/WriterVersion.java b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/WriterVersion.java
new file mode 100644
index 00000000..ab451afa
--- /dev/null
+++ b/java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/WriterVersion.java
@@ -0,0 +1,192 @@
+/*
+ * 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 com.lancedb.lance.catalog.client.apache.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.Objects;
+import java.util.StringJoiner;
+
+/** WriterVersion */
+@JsonPropertyOrder({WriterVersion.JSON_PROPERTY_LIBRARY, WriterVersion.JSON_PROPERTY_VERSION})
+@javax.annotation.Generated(
+ value = "org.openapitools.codegen.languages.JavaClientCodegen",
+ comments = "Generator version: 7.12.0")
+public class WriterVersion {
+ public static final String JSON_PROPERTY_LIBRARY = "library";
+ @javax.annotation.Nullable private String library;
+
+ public static final String JSON_PROPERTY_VERSION = "version";
+ @javax.annotation.Nullable private String version;
+
+ public WriterVersion() {}
+
+ public WriterVersion library(@javax.annotation.Nullable String library) {
+
+ this.library = library;
+ return this;
+ }
+
+ /**
+ * The name of the library that created this file.
+ *
+ * @return library
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_LIBRARY)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getLibrary() {
+ return library;
+ }
+
+ @JsonProperty(JSON_PROPERTY_LIBRARY)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setLibrary(@javax.annotation.Nullable String library) {
+ this.library = library;
+ }
+
+ public WriterVersion version(@javax.annotation.Nullable String version) {
+
+ this.version = version;
+ return this;
+ }
+
+ /**
+ * The version of the library that created this file. Because we cannot assume that the library is
+ * semantically versioned, this is a string. However, if it is semantically versioned, it should
+ * be a valid semver string without any 'v' prefix. For example: `2.0.0`,
+ * `2.0.0-rc.1`.
+ *
+ * @return version
+ */
+ @javax.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_VERSION)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getVersion() {
+ return version;
+ }
+
+ @JsonProperty(JSON_PROPERTY_VERSION)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setVersion(@javax.annotation.Nullable String version) {
+ this.version = version;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WriterVersion writerVersion = (WriterVersion) o;
+ return Objects.equals(this.library, writerVersion.library)
+ && Objects.equals(this.version, writerVersion.version);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(library, version);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WriterVersion {\n");
+ sb.append(" library: ").append(toIndentedString(library)).append("\n");
+ sb.append(" version: ").append(toIndentedString(version)).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 `library` to the URL query string
+ if (getLibrary() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%slibrary%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getLibrary()), "UTF-8").replaceAll("\\+", "%20")));
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+
+ // add `version` to the URL query string
+ if (getVersion() != null) {
+ try {
+ joiner.add(
+ String.format(
+ "%sversion%s=%s",
+ prefix,
+ suffix,
+ URLEncoder.encode(String.valueOf(getVersion()), "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-catalog-springboot-server/.openapi-generator/FILES b/java/lance-catalog-springboot-server/.openapi-generator/FILES
index 87f14163..e9435935 100644
--- a/java/lance-catalog-springboot-server/.openapi-generator/FILES
+++ b/java/lance-catalog-springboot-server/.openapi-generator/FILES
@@ -6,8 +6,12 @@ src/main/java/com/lancedb/lance/catalog/server/springboot/api/NamespaceApi.java
src/main/java/com/lancedb/lance/catalog/server/springboot/api/TableApi.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/CreateNamespaceRequest.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/CreateNamespaceResponse.java
+src/main/java/com/lancedb/lance/catalog/server/springboot/model/CreateTableRequest.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/ErrorResponse.java
+src/main/java/com/lancedb/lance/catalog/server/springboot/model/Field.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/GetNamespaceResponse.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/GetTableResponse.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/ListNamespacesResponse.java
src/main/java/com/lancedb/lance/catalog/server/springboot/model/RegisterTableRequest.java
+src/main/java/com/lancedb/lance/catalog/server/springboot/model/Schema.java
+src/main/java/com/lancedb/lance/catalog/server/springboot/model/WriterVersion.java
diff --git a/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/api/TableApi.java b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/api/TableApi.java
index 503834bc..af546b65 100644
--- a/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/api/TableApi.java
+++ b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/api/TableApi.java
@@ -13,6 +13,7 @@
*/
package com.lancedb.lance.catalog.server.springboot.api;
+import com.lancedb.lance.catalog.server.springboot.model.CreateTableRequest;
import com.lancedb.lance.catalog.server.springboot.model.ErrorResponse;
import com.lancedb.lance.catalog.server.springboot.model.GetTableResponse;
import com.lancedb.lance.catalog.server.springboot.model.RegisterTableRequest;
@@ -48,6 +49,183 @@ default Optional getRequest() {
return Optional.empty();
}
+ /**
+ * POST /v1/namespaces/{ns}/tables : Create a table in the catalog Create a new Lance table in the
+ * catalog. There are three modes when trying to create a table: * CREATE: Create the table if it
+ * does not exist. If a table of the same name already exists, the operation fails with 400. *
+ * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists,
+ * the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does
+ * not exist. If a table of the same name already exists, the existing table and all data is
+ * dropped and a new table with this name with no data is created. The server might create the
+ * table using a library and writer version that is different from the one in the user
+ * environment. The server is responsible for rejecting the request if the table created by the
+ * server cannot be properly used by the client library and writer version.
+ *
+ * @param ns The name of the namespace. (required)
+ * @param createTableRequest (required)
+ * @return Table properties result when loading 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,
+ * 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 Not Acceptable / Unsupported
+ * Operation. The server does not support this operation. (status code 406) 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)
+ */
+ @Operation(
+ operationId = "createTable",
+ summary = "Create a table in the catalog",
+ description =
+ "Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version. ",
+ tags = {"Table"},
+ responses = {
+ @ApiResponse(
+ responseCode = "200",
+ description = "Table properties result when loading a table",
+ content = {
+ @Content(
+ mediaType = "application/json",
+ schema = @Schema(implementation = GetTableResponse.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 = "406",
+ description =
+ "Not Acceptable / Unsupported Operation. The server does not support this operation.",
+ 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))
+ })
+ })
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = "/v1/namespaces/{ns}/tables",
+ produces = {"application/json"},
+ consumes = {"application/json"})
+ default ResponseEntity createTable(
+ @Parameter(
+ name = "ns",
+ description = "The name of the namespace.",
+ required = true,
+ in = ParameterIn.PATH)
+ @PathVariable("ns")
+ String ns,
+ @Parameter(name = "CreateTableRequest", description = "", required = true) @Valid @RequestBody
+ CreateTableRequest createTableRequest) {
+ getRequest()
+ .ifPresent(
+ request -> {
+ for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"name\" : \"name\", \"location\" : \"location\", \"properties\" : { \"key\" : \"properties\" } }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString =
+ "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
/**
* GET /v1/namespaces/{ns}/tables/{table} : Get a table from the catalog Get a table's
* detailed information under a specified namespace from the catalog.
diff --git a/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/CreateTableRequest.java b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/CreateTableRequest.java
new file mode 100644
index 00000000..7adbe5b5
--- /dev/null
+++ b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/CreateTableRequest.java
@@ -0,0 +1,333 @@
+/*
+ * 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 com.lancedb.lance.catalog.server.springboot.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import javax.annotation.Generated;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** CreateTableRequest */
+@Generated(
+ value = "org.openapitools.codegen.languages.SpringCodegen",
+ comments = "Generator version: 7.12.0")
+public class CreateTableRequest {
+
+ private String name;
+
+ /** Gets or Sets mode */
+ public enum ModeEnum {
+ CREATE("CREATE"),
+
+ EXIST_OK("EXIST_OK"),
+
+ OVERWRITE("OVERWRITE");
+
+ private String value;
+
+ ModeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static ModeEnum fromValue(String value) {
+ for (ModeEnum b : ModeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ private ModeEnum mode = ModeEnum.CREATE;
+
+ /** Gets or Sets type */
+ public enum TypeEnum {
+ STORAGE_MANAGED("STORAGE_MANAGED"),
+
+ CATALOG_MANAGED("CATALOG_MANAGED");
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ private TypeEnum type = TypeEnum.STORAGE_MANAGED;
+
+ private String location;
+
+ private Schema schema;
+
+ private WriterVersion writerVersion;
+
+ @Valid private Map config = new HashMap<>();
+
+ public CreateTableRequest() {
+ super();
+ }
+
+ /** Constructor with only required parameters */
+ public CreateTableRequest(String name, Schema schema) {
+ this.name = name;
+ this.schema = schema;
+ }
+
+ public CreateTableRequest name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ *
+ * @return name
+ */
+ @NotNull
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public CreateTableRequest mode(ModeEnum mode) {
+ this.mode = mode;
+ return this;
+ }
+
+ /**
+ * Get mode
+ *
+ * @return mode
+ */
+ @Schema(name = "mode", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("mode")
+ public ModeEnum getMode() {
+ return mode;
+ }
+
+ public void setMode(ModeEnum mode) {
+ this.mode = mode;
+ }
+
+ public CreateTableRequest type(TypeEnum type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ *
+ * @return type
+ */
+ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("type")
+ public TypeEnum getType() {
+ return type;
+ }
+
+ public void setType(TypeEnum type) {
+ this.type = type;
+ }
+
+ public CreateTableRequest 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 CreateTableRequest schema(Schema schema) {
+ this.schema = schema;
+ return this;
+ }
+
+ /**
+ * Get schema
+ *
+ * @return schema
+ */
+ @NotNull
+ @Valid
+ @Schema(name = "schema", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("schema")
+ public Schema getSchema() {
+ return schema;
+ }
+
+ public void setSchema(Schema schema) {
+ this.schema = schema;
+ }
+
+ public CreateTableRequest writerVersion(WriterVersion writerVersion) {
+ this.writerVersion = writerVersion;
+ return this;
+ }
+
+ /**
+ * Get writerVersion
+ *
+ * @return writerVersion
+ */
+ @Valid
+ @Schema(name = "writerVersion", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("writerVersion")
+ public WriterVersion getWriterVersion() {
+ return writerVersion;
+ }
+
+ public void setWriterVersion(WriterVersion writerVersion) {
+ this.writerVersion = writerVersion;
+ }
+
+ public CreateTableRequest config(Map config) {
+ this.config = config;
+ return this;
+ }
+
+ public CreateTableRequest putConfigItem(String key, String configItem) {
+ if (this.config == null) {
+ this.config = new HashMap<>();
+ }
+ this.config.put(key, configItem);
+ return this;
+ }
+
+ /**
+ * optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the
+ * Lance library. Other libraries may wish to similarly prefix their configuration keys
+ * appropriately.
+ *
+ * @return config
+ */
+ @Schema(
+ name = "config",
+ description =
+ "optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately. ",
+ requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("config")
+ public Map getConfig() {
+ return config;
+ }
+
+ public void setConfig(Map config) {
+ this.config = config;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CreateTableRequest createTableRequest = (CreateTableRequest) o;
+ return Objects.equals(this.name, createTableRequest.name)
+ && Objects.equals(this.mode, createTableRequest.mode)
+ && Objects.equals(this.type, createTableRequest.type)
+ && Objects.equals(this.location, createTableRequest.location)
+ && Objects.equals(this.schema, createTableRequest.schema)
+ && Objects.equals(this.writerVersion, createTableRequest.writerVersion)
+ && Objects.equals(this.config, createTableRequest.config);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, mode, type, location, schema, writerVersion, config);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CreateTableRequest {\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" mode: ").append(toIndentedString(mode)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" location: ").append(toIndentedString(location)).append("\n");
+ sb.append(" schema: ").append(toIndentedString(schema)).append("\n");
+ sb.append(" writerVersion: ").append(toIndentedString(writerVersion)).append("\n");
+ sb.append(" config: ").append(toIndentedString(config)).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-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/Field.java b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/Field.java
new file mode 100644
index 00000000..3bb806c5
--- /dev/null
+++ b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/Field.java
@@ -0,0 +1,314 @@
+/*
+ * 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 com.lancedb.lance.catalog.server.springboot.model;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import javax.annotation.Generated;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Field */
+@Generated(
+ value = "org.openapitools.codegen.languages.SpringCodegen",
+ comments = "Generator version: 7.12.0")
+public class Field {
+
+ /** Gets or Sets type */
+ public enum TypeEnum {
+ PARENT("PARENT"),
+
+ REPEATED("REPEATED"),
+
+ LEAF("LEAF");
+
+ private String value;
+
+ TypeEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static TypeEnum fromValue(String value) {
+ for (TypeEnum b : TypeEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+ }
+
+ private TypeEnum type;
+
+ private String name;
+
+ private Integer id = null;
+
+ private Integer parentId = null;
+
+ private String logicalType;
+
+ private Boolean nullable;
+
+ @Valid private Map metadata = new HashMap<>();
+
+ public Field() {
+ super();
+ }
+
+ /** Constructor with only required parameters */
+ public Field(TypeEnum type, String name, Integer id, String logicalType) {
+ this.type = type;
+ this.name = name;
+ this.id = id;
+ this.logicalType = logicalType;
+ }
+
+ public Field type(TypeEnum type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get type
+ *
+ * @return type
+ */
+ @NotNull
+ @Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("type")
+ public TypeEnum getType() {
+ return type;
+ }
+
+ public void setType(TypeEnum type) {
+ this.type = type;
+ }
+
+ public Field name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ *
+ * @return name
+ */
+ @NotNull
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Field id(Integer id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ *
+ * @return id
+ */
+ @NotNull
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("id")
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Field parentId(Integer parentId) {
+ this.parentId = parentId;
+ return this;
+ }
+
+ /**
+ * Get parentId
+ *
+ * @return parentId
+ */
+ @Schema(name = "parentId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("parentId")
+ public Integer getParentId() {
+ return parentId;
+ }
+
+ public void setParentId(Integer parentId) {
+ this.parentId = parentId;
+ }
+
+ public Field logicalType(String logicalType) {
+ this.logicalType = logicalType;
+ return this;
+ }
+
+ /**
+ * Logical types, currently support parameterized Arrow Type. PARENT types will always have
+ * logical type \"struct\". Logical type \"map\" is represented as a struct with a single child
+ * field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types
+ * may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\"
+ * The final two are used if the list values are structs, and therefore the field is both
+ * implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" *
+ * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\"
+ * * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" /
+ * \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" /
+ * \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" /
+ * \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" *
+ * \"dict:{value_type}:{index_type}:false\"
+ *
+ * @return logicalType
+ */
+ @NotNull
+ @Schema(
+ name = "logicalType",
+ description =
+ "Logical types, currently support parameterized Arrow Type. PARENT types will always have logical type \"struct\". Logical type \"map\" is represented as a struct with a single child field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" / \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" * \"dict:{value_type}:{index_type}:false\" ",
+ requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("logicalType")
+ public String getLogicalType() {
+ return logicalType;
+ }
+
+ public void setLogicalType(String logicalType) {
+ this.logicalType = logicalType;
+ }
+
+ public Field nullable(Boolean nullable) {
+ this.nullable = nullable;
+ return this;
+ }
+
+ /**
+ * Get nullable
+ *
+ * @return nullable
+ */
+ @Schema(name = "nullable", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("nullable")
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ public void setNullable(Boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ public Field metadata(Map metadata) {
+ this.metadata = metadata;
+ return this;
+ }
+
+ public Field putMetadataItem(String key, String metadataItem) {
+ if (this.metadata == null) {
+ this.metadata = new HashMap<>();
+ }
+ this.metadata.put(key, metadataItem);
+ return this;
+ }
+
+ /**
+ * optional field metadata (e.g. extension type name/parameters)
+ *
+ * @return metadata
+ */
+ @Schema(
+ name = "metadata",
+ description = "optional field metadata (e.g. extension type name/parameters)",
+ requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("metadata")
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(Map metadata) {
+ this.metadata = metadata;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Field field = (Field) o;
+ return Objects.equals(this.type, field.type)
+ && Objects.equals(this.name, field.name)
+ && Objects.equals(this.id, field.id)
+ && Objects.equals(this.parentId, field.parentId)
+ && Objects.equals(this.logicalType, field.logicalType)
+ && Objects.equals(this.nullable, field.nullable)
+ && Objects.equals(this.metadata, field.metadata);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, name, id, parentId, logicalType, nullable, metadata);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Field {\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n");
+ sb.append(" logicalType: ").append(toIndentedString(logicalType)).append("\n");
+ sb.append(" nullable: ").append(toIndentedString(nullable)).append("\n");
+ sb.append(" metadata: ").append(toIndentedString(metadata)).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-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/Schema.java b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/Schema.java
new file mode 100644
index 00000000..d1411580
--- /dev/null
+++ b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/Schema.java
@@ -0,0 +1,146 @@
+/*
+ * 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 com.lancedb.lance.catalog.server.springboot.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import javax.annotation.Generated;
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+
+import java.util.*;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+/** Schema */
+@Generated(
+ value = "org.openapitools.codegen.languages.SpringCodegen",
+ comments = "Generator version: 7.12.0")
+public class Schema {
+
+ @Valid private Map metadata = new HashMap<>();
+
+ @Valid private Set<@Valid Field> fields = new LinkedHashSet<>();
+
+ public Schema() {
+ super();
+ }
+
+ /** Constructor with only required parameters */
+ public Schema(Set<@Valid Field> fields) {
+ this.fields = fields;
+ }
+
+ public Schema metadata(Map metadata) {
+ this.metadata = metadata;
+ return this;
+ }
+
+ public Schema putMetadataItem(String key, String metadataItem) {
+ if (this.metadata == null) {
+ this.metadata = new HashMap<>();
+ }
+ this.metadata.put(key, metadataItem);
+ return this;
+ }
+
+ /**
+ * Get metadata
+ *
+ * @return metadata
+ */
+ @Schema(name = "metadata", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("metadata")
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(Map metadata) {
+ this.metadata = metadata;
+ }
+
+ public Schema fields(Set<@Valid Field> fields) {
+ this.fields = fields;
+ return this;
+ }
+
+ public Schema addFieldsItem(Field fieldsItem) {
+ if (this.fields == null) {
+ this.fields = new LinkedHashSet<>();
+ }
+ this.fields.add(fieldsItem);
+ return this;
+ }
+
+ /**
+ * Get fields
+ *
+ * @return fields
+ */
+ @NotNull
+ @Valid
+ @Schema(name = "fields", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonProperty("fields")
+ public Set<@Valid Field> getFields() {
+ return fields;
+ }
+
+ @JsonDeserialize(as = LinkedHashSet.class)
+ public void setFields(Set<@Valid Field> fields) {
+ this.fields = fields;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Schema schema = (Schema) o;
+ return Objects.equals(this.metadata, schema.metadata)
+ && Objects.equals(this.fields, schema.fields);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(metadata, fields);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Schema {\n");
+ sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
+ sb.append(" fields: ").append(toIndentedString(fields)).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-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/WriterVersion.java b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/WriterVersion.java
new file mode 100644
index 00000000..cc8904a0
--- /dev/null
+++ b/java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/WriterVersion.java
@@ -0,0 +1,121 @@
+/*
+ * 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 com.lancedb.lance.catalog.server.springboot.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+
+import javax.annotation.Generated;
+import javax.validation.constraints.*;
+
+import java.util.*;
+import java.util.Objects;
+
+/** WriterVersion */
+@Generated(
+ value = "org.openapitools.codegen.languages.SpringCodegen",
+ comments = "Generator version: 7.12.0")
+public class WriterVersion {
+
+ private String library;
+
+ private String version;
+
+ public WriterVersion library(String library) {
+ this.library = library;
+ return this;
+ }
+
+ /**
+ * The name of the library that created this file.
+ *
+ * @return library
+ */
+ @Schema(
+ name = "library",
+ description = "The name of the library that created this file.",
+ requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("library")
+ public String getLibrary() {
+ return library;
+ }
+
+ public void setLibrary(String library) {
+ this.library = library;
+ }
+
+ public WriterVersion version(String version) {
+ this.version = version;
+ return this;
+ }
+
+ /**
+ * The version of the library that created this file. Because we cannot assume that the library is
+ * semantically versioned, this is a string. However, if it is semantically versioned, it should
+ * be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`.
+ *
+ * @return version
+ */
+ @Schema(
+ name = "version",
+ description =
+ "The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`. ",
+ requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ @JsonProperty("version")
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WriterVersion writerVersion = (WriterVersion) o;
+ return Objects.equals(this.library, writerVersion.library)
+ && Objects.equals(this.version, writerVersion.version);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(library, version);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class WriterVersion {\n");
+ sb.append(" library: ").append(toIndentedString(library)).append("\n");
+ sb.append(" version: ").append(toIndentedString(version)).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/python/lance_catalog_urllib3_client/.openapi-generator/FILES b/python/lance_catalog_urllib3_client/.openapi-generator/FILES
index cc57bbd7..66e86cb4 100644
--- a/python/lance_catalog_urllib3_client/.openapi-generator/FILES
+++ b/python/lance_catalog_urllib3_client/.openapi-generator/FILES
@@ -5,13 +5,17 @@
README.md
docs/CreateNamespaceRequest.md
docs/CreateNamespaceResponse.md
+docs/CreateTableRequest.md
docs/ErrorResponse.md
docs/GetNamespaceResponse.md
docs/GetTableResponse.md
docs/ListNamespacesResponse.md
+docs/ModelField.md
+docs/ModelSchema.md
docs/NamespaceApi.md
docs/RegisterTableRequest.md
docs/TableApi.md
+docs/WriterVersion.md
git_push.sh
lance_catalog_urllib3_client/__init__.py
lance_catalog_urllib3_client/api/__init__.py
@@ -24,11 +28,15 @@ lance_catalog_urllib3_client/exceptions.py
lance_catalog_urllib3_client/models/__init__.py
lance_catalog_urllib3_client/models/create_namespace_request.py
lance_catalog_urllib3_client/models/create_namespace_response.py
+lance_catalog_urllib3_client/models/create_table_request.py
lance_catalog_urllib3_client/models/error_response.py
lance_catalog_urllib3_client/models/get_namespace_response.py
lance_catalog_urllib3_client/models/get_table_response.py
lance_catalog_urllib3_client/models/list_namespaces_response.py
+lance_catalog_urllib3_client/models/model_field.py
+lance_catalog_urllib3_client/models/model_schema.py
lance_catalog_urllib3_client/models/register_table_request.py
+lance_catalog_urllib3_client/models/writer_version.py
lance_catalog_urllib3_client/py.typed
lance_catalog_urllib3_client/rest.py
pyproject.toml
diff --git a/python/lance_catalog_urllib3_client/README.md b/python/lance_catalog_urllib3_client/README.md
index 260fbd56..c6a16907 100644
--- a/python/lance_catalog_urllib3_client/README.md
+++ b/python/lance_catalog_urllib3_client/README.md
@@ -96,6 +96,7 @@ Class | Method | HTTP request | Description
*NamespaceApi* | [**get_namespace**](docs/NamespaceApi.md#get_namespace) | **GET** /v1/namespaces/{ns} | Get information about a namespace
*NamespaceApi* | [**list_namespaces**](docs/NamespaceApi.md#list_namespaces) | **GET** /v1/namespaces | List all namespaces in the catalog.
*NamespaceApi* | [**namespace_exists**](docs/NamespaceApi.md#namespace_exists) | **HEAD** /v1/namespaces/{ns} | Check if a namespace exists
+*TableApi* | [**create_table**](docs/TableApi.md#create_table) | **POST** /v1/namespaces/{ns}/tables | Create a table in the catalog
*TableApi* | [**get_table**](docs/TableApi.md#get_table) | **GET** /v1/namespaces/{ns}/tables/{table} | Get a table from the catalog
*TableApi* | [**register_table**](docs/TableApi.md#register_table) | **POST** /v1/namespaces/{ns}/register | Register a new table in the given namespace. A table represents a lance dataset. In Lance catalog, a table must be hosted in a namespace.
*TableApi* | [**table_exists**](docs/TableApi.md#table_exists) | **HEAD** /v1/namespaces/{ns}/tables/{table} | Check if a table exists
@@ -105,11 +106,15 @@ Class | Method | HTTP request | Description
- [CreateNamespaceRequest](docs/CreateNamespaceRequest.md)
- [CreateNamespaceResponse](docs/CreateNamespaceResponse.md)
+ - [CreateTableRequest](docs/CreateTableRequest.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [GetNamespaceResponse](docs/GetNamespaceResponse.md)
- [GetTableResponse](docs/GetTableResponse.md)
- [ListNamespacesResponse](docs/ListNamespacesResponse.md)
+ - [ModelField](docs/ModelField.md)
+ - [ModelSchema](docs/ModelSchema.md)
- [RegisterTableRequest](docs/RegisterTableRequest.md)
+ - [WriterVersion](docs/WriterVersion.md)
diff --git a/python/lance_catalog_urllib3_client/docs/CreateTableRequest.md b/python/lance_catalog_urllib3_client/docs/CreateTableRequest.md
new file mode 100644
index 00000000..67df9cfa
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/docs/CreateTableRequest.md
@@ -0,0 +1,35 @@
+# CreateTableRequest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | |
+**mode** | **str** | | [optional] [default to 'CREATE']
+**type** | **str** | | [optional] [default to 'STORAGE_MANAGED']
+**location** | **str** | | [optional]
+**var_schema** | [**ModelSchema**](ModelSchema.md) | |
+**writer_version** | [**WriterVersion**](WriterVersion.md) | | [optional]
+**config** | **Dict[str, str]** | optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately. | [optional]
+
+## Example
+
+```python
+from lance_catalog_urllib3_client.models.create_table_request import CreateTableRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateTableRequest from a JSON string
+create_table_request_instance = CreateTableRequest.from_json(json)
+# print the JSON string representation of the object
+print(CreateTableRequest.to_json())
+
+# convert the object into a dict
+create_table_request_dict = create_table_request_instance.to_dict()
+# create an instance of CreateTableRequest from a dict
+create_table_request_from_dict = CreateTableRequest.from_dict(create_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_catalog_urllib3_client/docs/ModelField.md b/python/lance_catalog_urllib3_client/docs/ModelField.md
new file mode 100644
index 00000000..9fef1a50
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/docs/ModelField.md
@@ -0,0 +1,35 @@
+# ModelField
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **str** | |
+**name** | **str** | |
+**id** | [**Int**](Int.md) | |
+**parent_id** | [**Int**](Int.md) | | [optional]
+**logical_type** | **str** | Logical types, currently support parameterized Arrow Type. PARENT types will always have logical type \"struct\". Logical type \"map\" is represented as a struct with a single child field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" / \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" * \"dict:{value_type}:{index_type}:false\" |
+**nullable** | **bool** | | [optional]
+**metadata** | **Dict[str, str]** | optional field metadata (e.g. extension type name/parameters) | [optional]
+
+## Example
+
+```python
+from lance_catalog_urllib3_client.models.model_field import ModelField
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelField from a JSON string
+model_field_instance = ModelField.from_json(json)
+# print the JSON string representation of the object
+print(ModelField.to_json())
+
+# convert the object into a dict
+model_field_dict = model_field_instance.to_dict()
+# create an instance of ModelField from a dict
+model_field_from_dict = ModelField.from_dict(model_field_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_catalog_urllib3_client/docs/ModelSchema.md b/python/lance_catalog_urllib3_client/docs/ModelSchema.md
new file mode 100644
index 00000000..347cf83b
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/docs/ModelSchema.md
@@ -0,0 +1,30 @@
+# ModelSchema
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**metadata** | **Dict[str, str]** | | [optional]
+**fields** | [**List[ModelField]**](ModelField.md) | |
+
+## Example
+
+```python
+from lance_catalog_urllib3_client.models.model_schema import ModelSchema
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelSchema from a JSON string
+model_schema_instance = ModelSchema.from_json(json)
+# print the JSON string representation of the object
+print(ModelSchema.to_json())
+
+# convert the object into a dict
+model_schema_dict = model_schema_instance.to_dict()
+# create an instance of ModelSchema from a dict
+model_schema_from_dict = ModelSchema.from_dict(model_schema_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_catalog_urllib3_client/docs/TableApi.md b/python/lance_catalog_urllib3_client/docs/TableApi.md
index c89f76d1..3ab3c394 100644
--- a/python/lance_catalog_urllib3_client/docs/TableApi.md
+++ b/python/lance_catalog_urllib3_client/docs/TableApi.md
@@ -4,11 +4,93 @@ All URIs are relative to *http://localhost:2333*
Method | HTTP request | Description
------------- | ------------- | -------------
+[**create_table**](TableApi.md#create_table) | **POST** /v1/namespaces/{ns}/tables | Create a table in the catalog
[**get_table**](TableApi.md#get_table) | **GET** /v1/namespaces/{ns}/tables/{table} | Get a table from the catalog
[**register_table**](TableApi.md#register_table) | **POST** /v1/namespaces/{ns}/register | Register a new table in the given namespace. A table represents a lance dataset. In Lance catalog, a table must be hosted in a namespace.
[**table_exists**](TableApi.md#table_exists) | **HEAD** /v1/namespaces/{ns}/tables/{table} | Check if a table exists
+# **create_table**
+> GetTableResponse create_table(ns, create_table_request)
+
+Create a table in the catalog
+
+Create a new Lance table in the catalog.
+There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created.
+The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+
+
+### Example
+
+
+```python
+import lance_catalog_urllib3_client
+from lance_catalog_urllib3_client.models.create_table_request import CreateTableRequest
+from lance_catalog_urllib3_client.models.get_table_response import GetTableResponse
+from lance_catalog_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_catalog_urllib3_client.Configuration(
+ host = "http://localhost:2333"
+)
+
+
+# Enter a context with an instance of the API client
+with lance_catalog_urllib3_client.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = lance_catalog_urllib3_client.TableApi(api_client)
+ ns = 'ns_example' # str | The name of the namespace.
+ create_table_request = lance_catalog_urllib3_client.CreateTableRequest() # CreateTableRequest |
+
+ try:
+ # Create a table in the catalog
+ api_response = api_instance.create_table(ns, create_table_request)
+ print("The response of TableApi->create_table:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling TableApi->create_table: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ns** | **str**| The name of the namespace. |
+ **create_table_request** | [**CreateTableRequest**](CreateTableRequest.md)| |
+
+### Return type
+
+[**GetTableResponse**](GetTableResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Table properties result when loading a 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. | - |
+**406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - |
+**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)
+
# **get_table**
> GetTableResponse get_table(ns, table)
diff --git a/python/lance_catalog_urllib3_client/docs/WriterVersion.md b/python/lance_catalog_urllib3_client/docs/WriterVersion.md
new file mode 100644
index 00000000..27f061e9
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/docs/WriterVersion.md
@@ -0,0 +1,30 @@
+# WriterVersion
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**library** | **str** | The name of the library that created this file. | [optional]
+**version** | **str** | The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`. | [optional]
+
+## Example
+
+```python
+from lance_catalog_urllib3_client.models.writer_version import WriterVersion
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WriterVersion from a JSON string
+writer_version_instance = WriterVersion.from_json(json)
+# print the JSON string representation of the object
+print(WriterVersion.to_json())
+
+# convert the object into a dict
+writer_version_dict = writer_version_instance.to_dict()
+# create an instance of WriterVersion from a dict
+writer_version_from_dict = WriterVersion.from_dict(writer_version_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_catalog_urllib3_client/lance_catalog_urllib3_client/__init__.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/__init__.py
index 043e35bf..f1394612 100644
--- a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/__init__.py
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/__init__.py
@@ -34,8 +34,12 @@
# import models into sdk package
from lance_catalog_urllib3_client.models.create_namespace_request import CreateNamespaceRequest
from lance_catalog_urllib3_client.models.create_namespace_response import CreateNamespaceResponse
+from lance_catalog_urllib3_client.models.create_table_request import CreateTableRequest
from lance_catalog_urllib3_client.models.error_response import ErrorResponse
from lance_catalog_urllib3_client.models.get_namespace_response import GetNamespaceResponse
from lance_catalog_urllib3_client.models.get_table_response import GetTableResponse
from lance_catalog_urllib3_client.models.list_namespaces_response import ListNamespacesResponse
+from lance_catalog_urllib3_client.models.model_field import ModelField
+from lance_catalog_urllib3_client.models.model_schema import ModelSchema
from lance_catalog_urllib3_client.models.register_table_request import RegisterTableRequest
+from lance_catalog_urllib3_client.models.writer_version import WriterVersion
diff --git a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/api/table_api.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/api/table_api.py
index 37c7b3c0..35b88c53 100644
--- a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/api/table_api.py
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/api/table_api.py
@@ -18,6 +18,7 @@
from pydantic import Field, StrictStr
from typing_extensions import Annotated
+from lance_catalog_urllib3_client.models.create_table_request import CreateTableRequest
from lance_catalog_urllib3_client.models.get_table_response import GetTableResponse
from lance_catalog_urllib3_client.models.register_table_request import RegisterTableRequest
@@ -39,6 +40,315 @@ def __init__(self, api_client=None) -> None:
self.api_client = api_client
+ @validate_call
+ def create_table(
+ self,
+ ns: Annotated[StrictStr, Field(description="The name of the namespace.")],
+ create_table_request: CreateTableRequest,
+ _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,
+ ) -> GetTableResponse:
+ """Create a table in the catalog
+
+ Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+
+ :param ns: The name of the namespace. (required)
+ :type ns: str
+ :param create_table_request: (required)
+ :type create_table_request: CreateTableRequest
+ :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
+
+ _param = self._create_table_serialize(
+ ns=ns,
+ create_table_request=create_table_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "GetTableResponse",
+ '400': "ErrorResponse",
+ '401': "ErrorResponse",
+ '403': "ErrorResponse",
+ '406': "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_table_with_http_info(
+ self,
+ ns: Annotated[StrictStr, Field(description="The name of the namespace.")],
+ create_table_request: CreateTableRequest,
+ _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[GetTableResponse]:
+ """Create a table in the catalog
+
+ Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+
+ :param ns: The name of the namespace. (required)
+ :type ns: str
+ :param create_table_request: (required)
+ :type create_table_request: CreateTableRequest
+ :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
+
+ _param = self._create_table_serialize(
+ ns=ns,
+ create_table_request=create_table_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "GetTableResponse",
+ '400': "ErrorResponse",
+ '401': "ErrorResponse",
+ '403': "ErrorResponse",
+ '406': "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_table_without_preload_content(
+ self,
+ ns: Annotated[StrictStr, Field(description="The name of the namespace.")],
+ create_table_request: CreateTableRequest,
+ _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:
+ """Create a table in the catalog
+
+ Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+
+ :param ns: The name of the namespace. (required)
+ :type ns: str
+ :param create_table_request: (required)
+ :type create_table_request: CreateTableRequest
+ :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
+
+ _param = self._create_table_serialize(
+ ns=ns,
+ create_table_request=create_table_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "GetTableResponse",
+ '400': "ErrorResponse",
+ '401': "ErrorResponse",
+ '403': "ErrorResponse",
+ '406': "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_table_serialize(
+ self,
+ ns,
+ create_table_request,
+ _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 ns is not None:
+ _path_params['ns'] = ns
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if create_table_request is not None:
+ _body_params = create_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] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/v1/namespaces/{ns}/tables',
+ 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 get_table(
self,
diff --git a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/__init__.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/__init__.py
index db5a6336..3c47bab7 100644
--- a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/__init__.py
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/__init__.py
@@ -16,8 +16,12 @@
# import models into model package
from lance_catalog_urllib3_client.models.create_namespace_request import CreateNamespaceRequest
from lance_catalog_urllib3_client.models.create_namespace_response import CreateNamespaceResponse
+from lance_catalog_urllib3_client.models.create_table_request import CreateTableRequest
from lance_catalog_urllib3_client.models.error_response import ErrorResponse
from lance_catalog_urllib3_client.models.get_namespace_response import GetNamespaceResponse
from lance_catalog_urllib3_client.models.get_table_response import GetTableResponse
from lance_catalog_urllib3_client.models.list_namespaces_response import ListNamespacesResponse
+from lance_catalog_urllib3_client.models.model_field import ModelField
+from lance_catalog_urllib3_client.models.model_schema import ModelSchema
from lance_catalog_urllib3_client.models.register_table_request import RegisterTableRequest
+from lance_catalog_urllib3_client.models.writer_version import WriterVersion
diff --git a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/create_table_request.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/create_table_request.py
new file mode 100644
index 00000000..6cf0b51f
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/create_table_request.py
@@ -0,0 +1,127 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ 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, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from lance_catalog_urllib3_client.models.model_schema import ModelSchema
+from lance_catalog_urllib3_client.models.writer_version import WriterVersion
+from typing import Optional, Set
+from typing_extensions import Self
+
+class CreateTableRequest(BaseModel):
+ """
+ CreateTableRequest
+ """ # noqa: E501
+ name: StrictStr
+ mode: Optional[StrictStr] = 'CREATE'
+ type: Optional[StrictStr] = 'STORAGE_MANAGED'
+ location: Optional[StrictStr] = None
+ var_schema: ModelSchema = Field(alias="schema")
+ writer_version: Optional[WriterVersion] = Field(default=None, alias="writerVersion")
+ config: Optional[Dict[str, StrictStr]] = Field(default=None, description="optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately. ")
+ __properties: ClassVar[List[str]] = ["name", "mode", "type", "location", "schema", "writerVersion", "config"]
+
+ @field_validator('mode')
+ def mode_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['CREATE', 'EXIST_OK', 'OVERWRITE']):
+ raise ValueError("must be one of enum values ('CREATE', 'EXIST_OK', 'OVERWRITE')")
+ return value
+
+ @field_validator('type')
+ def type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['STORAGE_MANAGED', 'CATALOG_MANAGED']):
+ raise ValueError("must be one of enum values ('STORAGE_MANAGED', 'CATALOG_MANAGED')")
+ return value
+
+ 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 CreateTableRequest 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 var_schema
+ if self.var_schema:
+ _dict['schema'] = self.var_schema.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of writer_version
+ if self.writer_version:
+ _dict['writerVersion'] = self.writer_version.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of CreateTableRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "mode": obj.get("mode") if obj.get("mode") is not None else 'CREATE',
+ "type": obj.get("type") if obj.get("type") is not None else 'STORAGE_MANAGED',
+ "location": obj.get("location"),
+ "schema": ModelSchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None,
+ "writerVersion": WriterVersion.from_dict(obj["writerVersion"]) if obj.get("writerVersion") is not None else None,
+ "config": obj.get("config")
+ })
+ return _obj
+
+
diff --git a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/model_field.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/model_field.py
new file mode 100644
index 00000000..f7bbb0d7
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/model_field.py
@@ -0,0 +1,112 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ 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, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ModelField(BaseModel):
+ """
+ ModelField
+ """ # noqa: E501
+ type: StrictStr
+ name: StrictStr
+ id: Int
+ parent_id: Optional[Int] = Field(default=None, alias="parentId")
+ logical_type: StrictStr = Field(description="Logical types, currently support parameterized Arrow Type. PARENT types will always have logical type \"struct\". Logical type \"map\" is represented as a struct with a single child field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" / \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" * \"dict:{value_type}:{index_type}:false\" ", alias="logicalType")
+ nullable: Optional[StrictBool] = None
+ metadata: Optional[Dict[str, StrictStr]] = Field(default=None, description="optional field metadata (e.g. extension type name/parameters)")
+ __properties: ClassVar[List[str]] = ["type", "name", "id", "parentId", "logicalType", "nullable", "metadata"]
+
+ @field_validator('type')
+ def type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['PARENT', 'REPEATED', 'LEAF']):
+ raise ValueError("must be one of enum values ('PARENT', 'REPEATED', 'LEAF')")
+ return value
+
+ 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 ModelField 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 id
+ if self.id:
+ _dict['id'] = self.id.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of parent_id
+ if self.parent_id:
+ _dict['parentId'] = self.parent_id.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ModelField from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "type": obj.get("type"),
+ "name": obj.get("name"),
+ "id": Int.from_dict(obj["id"]) if obj.get("id") is not None else None,
+ "parentId": Int.from_dict(obj["parentId"]) if obj.get("parentId") is not None else None,
+ "logicalType": obj.get("logicalType"),
+ "nullable": obj.get("nullable"),
+ "metadata": obj.get("metadata")
+ })
+ return _obj
+
+
diff --git a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/model_schema.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/model_schema.py
new file mode 100644
index 00000000..25c70d41
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/model_schema.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ 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, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from lance_catalog_urllib3_client.models.model_field import ModelField
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ModelSchema(BaseModel):
+ """
+ ModelSchema
+ """ # noqa: E501
+ metadata: Optional[Dict[str, StrictStr]] = None
+ fields: List[ModelField]
+ __properties: ClassVar[List[str]] = ["metadata", "fields"]
+
+ 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 ModelSchema 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 each item in fields (list)
+ _items = []
+ if self.fields:
+ for _item_fields in self.fields:
+ if _item_fields:
+ _items.append(_item_fields.to_dict())
+ _dict['fields'] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ModelSchema from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "metadata": obj.get("metadata"),
+ "fields": [ModelField.from_dict(_item) for _item in obj["fields"]] if obj.get("fields") is not None else None
+ })
+ return _obj
+
+
diff --git a/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/writer_version.py b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/writer_version.py
new file mode 100644
index 00000000..0013292b
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/lance_catalog_urllib3_client/models/writer_version.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ 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 WriterVersion(BaseModel):
+ """
+ WriterVersion
+ """ # noqa: E501
+ library: Optional[StrictStr] = Field(default=None, description="The name of the library that created this file.")
+ version: Optional[StrictStr] = Field(default=None, description="The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`. ")
+ __properties: ClassVar[List[str]] = ["library", "version"]
+
+ 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 WriterVersion 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 WriterVersion from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "library": obj.get("library"),
+ "version": obj.get("version")
+ })
+ return _obj
+
+
diff --git a/python/lance_catalog_urllib3_client/test/test_create_table_request.py b/python/lance_catalog_urllib3_client/test/test_create_table_request.py
new file mode 100644
index 00000000..51ff06ac
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/test/test_create_table_request.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lance_catalog_urllib3_client.models.create_table_request import CreateTableRequest
+
+class TestCreateTableRequest(unittest.TestCase):
+ """CreateTableRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> CreateTableRequest:
+ """Test CreateTableRequest
+ 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 `CreateTableRequest`
+ """
+ model = CreateTableRequest()
+ if include_optional:
+ return CreateTableRequest(
+ name = '',
+ mode = 'CREATE',
+ location = '',
+ var_schema = lance_catalog_urllib3_client.models.schema.Schema(
+ metadata = {
+ 'key' : ''
+ },
+ fields = [
+ lance_catalog_urllib3_client.models.field.Field(
+ type = 'PARENT',
+ name = '',
+ id = null,
+ parent_id = null,
+ logical_type = '',
+ nullable = True, )
+ ], ),
+ writer_version = lance_catalog_urllib3_client.models.writer_version.WriterVersion(
+ library = '',
+ version = '', ),
+ config = {
+ 'key' : ''
+ }
+ )
+ else:
+ return CreateTableRequest(
+ name = '',
+ var_schema = lance_catalog_urllib3_client.models.schema.Schema(
+ metadata = {
+ 'key' : ''
+ },
+ fields = [
+ lance_catalog_urllib3_client.models.field.Field(
+ type = 'PARENT',
+ name = '',
+ id = null,
+ parent_id = null,
+ logical_type = '',
+ nullable = True, )
+ ], ),
+ )
+ """
+
+ def testCreateTableRequest(self):
+ """Test CreateTableRequest"""
+ # 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_catalog_urllib3_client/test/test_model_field.py b/python/lance_catalog_urllib3_client/test/test_model_field.py
new file mode 100644
index 00000000..8716cbbc
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/test/test_model_field.py
@@ -0,0 +1,63 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lance_catalog_urllib3_client.models.model_field import ModelField
+
+class TestModelField(unittest.TestCase):
+ """ModelField unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ModelField:
+ """Test ModelField
+ 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 `ModelField`
+ """
+ model = ModelField()
+ if include_optional:
+ return ModelField(
+ type = 'PARENT',
+ name = '',
+ id = None,
+ parent_id = None,
+ logical_type = '',
+ nullable = True,
+ metadata = {
+ 'key' : ''
+ }
+ )
+ else:
+ return ModelField(
+ type = 'PARENT',
+ name = '',
+ id = None,
+ logical_type = '',
+ )
+ """
+
+ def testModelField(self):
+ """Test ModelField"""
+ # 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_catalog_urllib3_client/test/test_model_schema.py b/python/lance_catalog_urllib3_client/test/test_model_schema.py
new file mode 100644
index 00000000..bc0ab19b
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/test/test_model_schema.py
@@ -0,0 +1,77 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lance_catalog_urllib3_client.models.model_schema import ModelSchema
+
+class TestModelSchema(unittest.TestCase):
+ """ModelSchema unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ModelSchema:
+ """Test ModelSchema
+ 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 `ModelSchema`
+ """
+ model = ModelSchema()
+ if include_optional:
+ return ModelSchema(
+ metadata = {
+ 'key' : ''
+ },
+ fields = [
+ lance_catalog_urllib3_client.models.field.Field(
+ type = 'PARENT',
+ name = '',
+ id = null,
+ parent_id = null,
+ logical_type = '',
+ nullable = True,
+ metadata = {
+ 'key' : ''
+ }, )
+ ]
+ )
+ else:
+ return ModelSchema(
+ fields = [
+ lance_catalog_urllib3_client.models.field.Field(
+ type = 'PARENT',
+ name = '',
+ id = null,
+ parent_id = null,
+ logical_type = '',
+ nullable = True,
+ metadata = {
+ 'key' : ''
+ }, )
+ ],
+ )
+ """
+
+ def testModelSchema(self):
+ """Test ModelSchema"""
+ # 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_catalog_urllib3_client/test/test_writer_version.py b/python/lance_catalog_urllib3_client/test/test_writer_version.py
new file mode 100644
index 00000000..afe02088
--- /dev/null
+++ b/python/lance_catalog_urllib3_client/test/test_writer_version.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ Lance Catalog REST Specification
+
+ **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+
+ The version of the OpenAPI document: 0.0.1
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from lance_catalog_urllib3_client.models.writer_version import WriterVersion
+
+class TestWriterVersion(unittest.TestCase):
+ """WriterVersion unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WriterVersion:
+ """Test WriterVersion
+ 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 `WriterVersion`
+ """
+ model = WriterVersion()
+ if include_optional:
+ return WriterVersion(
+ library = '',
+ version = ''
+ )
+ else:
+ return WriterVersion(
+ )
+ """
+
+ def testWriterVersion(self):
+ """Test WriterVersion"""
+ # 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/rust/lance-catalog-reqwest-client/.openapi-generator/FILES b/rust/lance-catalog-reqwest-client/.openapi-generator/FILES
index 6ddedffd..644481de 100644
--- a/rust/lance-catalog-reqwest-client/.openapi-generator/FILES
+++ b/rust/lance-catalog-reqwest-client/.openapi-generator/FILES
@@ -4,13 +4,17 @@ Cargo.toml
README.md
docs/CreateNamespaceRequest.md
docs/CreateNamespaceResponse.md
+docs/CreateTableRequest.md
docs/ErrorResponse.md
+docs/Field.md
docs/GetNamespaceResponse.md
docs/GetTableResponse.md
docs/ListNamespacesResponse.md
docs/NamespaceApi.md
docs/RegisterTableRequest.md
+docs/Schema.md
docs/TableApi.md
+docs/WriterVersion.md
git_push.sh
src/apis/configuration.rs
src/apis/mod.rs
@@ -19,9 +23,13 @@ src/apis/table_api.rs
src/lib.rs
src/models/create_namespace_request.rs
src/models/create_namespace_response.rs
+src/models/create_table_request.rs
src/models/error_response.rs
+src/models/field.rs
src/models/get_namespace_response.rs
src/models/get_table_response.rs
src/models/list_namespaces_response.rs
src/models/mod.rs
src/models/register_table_request.rs
+src/models/schema.rs
+src/models/writer_version.rs
diff --git a/rust/lance-catalog-reqwest-client/README.md b/rust/lance-catalog-reqwest-client/README.md
index 90567406..b382e52a 100644
--- a/rust/lance-catalog-reqwest-client/README.md
+++ b/rust/lance-catalog-reqwest-client/README.md
@@ -37,6 +37,7 @@ Class | Method | HTTP request | Description
*NamespaceApi* | [**get_namespace**](docs/NamespaceApi.md#get_namespace) | **GET** /v1/namespaces/{ns} | Get information about a namespace
*NamespaceApi* | [**list_namespaces**](docs/NamespaceApi.md#list_namespaces) | **GET** /v1/namespaces | List all namespaces in the catalog.
*NamespaceApi* | [**namespace_exists**](docs/NamespaceApi.md#namespace_exists) | **HEAD** /v1/namespaces/{ns} | Check if a namespace exists
+*TableApi* | [**create_table**](docs/TableApi.md#create_table) | **POST** /v1/namespaces/{ns}/tables | Create a table in the catalog
*TableApi* | [**get_table**](docs/TableApi.md#get_table) | **GET** /v1/namespaces/{ns}/tables/{table} | Get a table from the catalog
*TableApi* | [**register_table**](docs/TableApi.md#register_table) | **POST** /v1/namespaces/{ns}/register | Register a new table in the given namespace. A table represents a lance dataset. In Lance catalog, a table must be hosted in a namespace.
*TableApi* | [**table_exists**](docs/TableApi.md#table_exists) | **HEAD** /v1/namespaces/{ns}/tables/{table} | Check if a table exists
@@ -46,11 +47,15 @@ Class | Method | HTTP request | Description
- [CreateNamespaceRequest](docs/CreateNamespaceRequest.md)
- [CreateNamespaceResponse](docs/CreateNamespaceResponse.md)
+ - [CreateTableRequest](docs/CreateTableRequest.md)
- [ErrorResponse](docs/ErrorResponse.md)
+ - [Field](docs/Field.md)
- [GetNamespaceResponse](docs/GetNamespaceResponse.md)
- [GetTableResponse](docs/GetTableResponse.md)
- [ListNamespacesResponse](docs/ListNamespacesResponse.md)
- [RegisterTableRequest](docs/RegisterTableRequest.md)
+ - [Schema](docs/Schema.md)
+ - [WriterVersion](docs/WriterVersion.md)
To get access to the crate's generated documentation, use:
diff --git a/rust/lance-catalog-reqwest-client/docs/CreateTableRequest.md b/rust/lance-catalog-reqwest-client/docs/CreateTableRequest.md
new file mode 100644
index 00000000..c05e0e58
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/docs/CreateTableRequest.md
@@ -0,0 +1,17 @@
+# CreateTableRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | |
+**mode** | Option<**String**> | | [optional][default to Create]
+**r#type** | Option<**String**> | | [optional][default to StorageManaged]
+**location** | Option<**String**> | | [optional]
+**schema** | [**models::Schema**](Schema.md) | |
+**writer_version** | Option<[**models::WriterVersion**](WriterVersion.md)> | | [optional]
+**config** | Option<**std::collections::HashMap**> | optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately. | [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-catalog-reqwest-client/docs/Field.md b/rust/lance-catalog-reqwest-client/docs/Field.md
new file mode 100644
index 00000000..1b60b574
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/docs/Field.md
@@ -0,0 +1,17 @@
+# Field
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**r#type** | **String** | |
+**name** | **String** | |
+**id** | [**models::Int**](int.md) | |
+**parent_id** | Option<[**models::Int**](int.md)> | | [optional]
+**logical_type** | **String** | Logical types, currently support parameterized Arrow Type. PARENT types will always have logical type \"struct\". Logical type \"map\" is represented as a struct with a single child field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" / \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" * \"dict:{value_type}:{index_type}:false\" |
+**nullable** | Option<**bool**> | | [optional]
+**metadata** | Option<**std::collections::HashMap**> | optional field metadata (e.g. extension type name/parameters) | [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-catalog-reqwest-client/docs/Schema.md b/rust/lance-catalog-reqwest-client/docs/Schema.md
new file mode 100644
index 00000000..3375fc35
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/docs/Schema.md
@@ -0,0 +1,12 @@
+# Schema
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**metadata** | Option<**std::collections::HashMap**> | | [optional]
+**fields** | [**Vec**](Field.md) | |
+
+[[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-catalog-reqwest-client/docs/TableApi.md b/rust/lance-catalog-reqwest-client/docs/TableApi.md
index 715e5115..e862f33b 100644
--- a/rust/lance-catalog-reqwest-client/docs/TableApi.md
+++ b/rust/lance-catalog-reqwest-client/docs/TableApi.md
@@ -4,12 +4,44 @@ All URIs are relative to *http://localhost:2333*
Method | HTTP request | Description
------------- | ------------- | -------------
+[**create_table**](TableApi.md#create_table) | **POST** /v1/namespaces/{ns}/tables | Create a table in the catalog
[**get_table**](TableApi.md#get_table) | **GET** /v1/namespaces/{ns}/tables/{table} | Get a table from the catalog
[**register_table**](TableApi.md#register_table) | **POST** /v1/namespaces/{ns}/register | Register a new table in the given namespace. A table represents a lance dataset. In Lance catalog, a table must be hosted in a namespace.
[**table_exists**](TableApi.md#table_exists) | **HEAD** /v1/namespaces/{ns}/tables/{table} | Check if a table exists
+## create_table
+
+> models::GetTableResponse create_table(ns, create_table_request)
+Create a table in the catalog
+
+Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+
+### Parameters
+
+
+Name | Type | Description | Required | Notes
+------------- | ------------- | ------------- | ------------- | -------------
+**ns** | **String** | The name of the namespace. | [required] |
+**create_table_request** | [**CreateTableRequest**](CreateTableRequest.md) | | [required] |
+
+### Return type
+
+[**models::GetTableResponse**](GetTableResponse.md)
+
+### Authorization
+
+No authorization required
+
+### 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)
+
+
## get_table
> models::GetTableResponse get_table(ns, table)
diff --git a/rust/lance-catalog-reqwest-client/docs/WriterVersion.md b/rust/lance-catalog-reqwest-client/docs/WriterVersion.md
new file mode 100644
index 00000000..1c08124a
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/docs/WriterVersion.md
@@ -0,0 +1,12 @@
+# WriterVersion
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**library** | Option<**String**> | The name of the library that created this file. | [optional]
+**version** | Option<**String**> | The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`. | [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-catalog-reqwest-client/src/apis/table_api.rs b/rust/lance-catalog-reqwest-client/src/apis/table_api.rs
index a39efd74..b1495501 100644
--- a/rust/lance-catalog-reqwest-client/src/apis/table_api.rs
+++ b/rust/lance-catalog-reqwest-client/src/apis/table_api.rs
@@ -15,6 +15,20 @@ use crate::{apis::ResponseContent, models};
use super::{Error, configuration, ContentType};
+/// struct for typed errors of method [`create_table`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateTableError {
+ Status400(models::ErrorResponse),
+ Status401(models::ErrorResponse),
+ Status403(models::ErrorResponse),
+ Status406(models::ErrorResponse),
+ Status409(models::ErrorResponse),
+ Status503(models::ErrorResponse),
+ Status5XX(models::ErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// struct for typed errors of method [`get_table`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -56,6 +70,45 @@ pub enum TableExistsError {
}
+/// Create a new Lance table in the catalog. There are three modes when trying to create a table: * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400. * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept. * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created. The server might create the table using a library and writer version that is different from the one in the user environment. The server is responsible for rejecting the request if the table created by the server cannot be properly used by the client library and writer version.
+pub async fn create_table(configuration: &configuration::Configuration, ns: &str, create_table_request: models::CreateTableRequest) -> Result> {
+ // add a prefix to parameters to efficiently prevent name collisions
+ let p_ns = ns;
+ let p_create_table_request = create_table_request;
+
+ let uri_str = format!("{}/v1/namespaces/{ns}/tables", configuration.base_path, ns=crate::apis::urlencode(p_ns));
+ let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
+
+ if let Some(ref user_agent) = configuration.user_agent {
+ req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
+ }
+ req_builder = req_builder.json(&p_create_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::GetTableResponse`"))),
+ 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::GetTableResponse`")))),
+ }
+ } else {
+ let content = resp.text().await?;
+ let entity: Option = serde_json::from_str(&content).ok();
+ Err(Error::ResponseError(ResponseContent { status, content, entity }))
+ }
+}
+
/// Get a table's detailed information under a specified namespace from the catalog.
pub async fn get_table(configuration: &configuration::Configuration, ns: &str, table: &str) -> Result> {
// add a prefix to parameters to efficiently prevent name collisions
diff --git a/rust/lance-catalog-reqwest-client/src/models/create_table_request.rs b/rust/lance-catalog-reqwest-client/src/models/create_table_request.rs
new file mode 100644
index 00000000..3677bdc7
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/src/models/create_table_request.rs
@@ -0,0 +1,76 @@
+/*
+ * Lance Catalog REST Specification
+ *
+ * **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct CreateTableRequest {
+ #[serde(rename = "name")]
+ pub name: String,
+ #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
+ pub mode: Option,
+ #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
+ pub r#type: Option,
+ #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
+ pub location: Option,
+ #[serde(rename = "schema")]
+ pub schema: Box,
+ #[serde(rename = "writerVersion", skip_serializing_if = "Option::is_none")]
+ pub writer_version: Option>,
+ /// optional configurations for the table. Keys with the prefix \"lance.\" are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately.
+ #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
+ pub config: Option>,
+}
+
+impl CreateTableRequest {
+ pub fn new(name: String, schema: models::Schema) -> CreateTableRequest {
+ CreateTableRequest {
+ name,
+ mode: None,
+ r#type: None,
+ location: None,
+ schema: Box::new(schema),
+ writer_version: None,
+ config: None,
+ }
+ }
+}
+///
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
+pub enum Mode {
+ #[serde(rename = "CREATE")]
+ Create,
+ #[serde(rename = "EXIST_OK")]
+ ExistOk,
+ #[serde(rename = "OVERWRITE")]
+ Overwrite,
+}
+
+impl Default for Mode {
+ fn default() -> Mode {
+ Self::Create
+ }
+}
+///
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
+pub enum Type {
+ #[serde(rename = "STORAGE_MANAGED")]
+ StorageManaged,
+ #[serde(rename = "CATALOG_MANAGED")]
+ CatalogManaged,
+}
+
+impl Default for Type {
+ fn default() -> Type {
+ Self::StorageManaged
+ }
+}
+
diff --git a/rust/lance-catalog-reqwest-client/src/models/field.rs b/rust/lance-catalog-reqwest-client/src/models/field.rs
new file mode 100644
index 00000000..0d1ff605
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/src/models/field.rs
@@ -0,0 +1,63 @@
+/*
+ * Lance Catalog REST Specification
+ *
+ * **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct Field {
+ #[serde(rename = "type")]
+ pub r#type: Type,
+ #[serde(rename = "name")]
+ pub name: String,
+ #[serde(rename = "id")]
+ pub id: models::Int,
+ #[serde(rename = "parentId", skip_serializing_if = "Option::is_none")]
+ pub parent_id: Option,
+ /// Logical types, currently support parameterized Arrow Type. PARENT types will always have logical type \"struct\". Logical type \"map\" is represented as a struct with a single child field \"entries\". \"entries\" is a struct with fields \"key\" and \"value\". REPEATED types may have logical types: * \"list\" * \"large_list\" * \"list.struct\" * \"large_list.struct\" The final two are used if the list values are structs, and therefore the field is both implicitly REPEATED and PARENT. LEAF types may have logical types: * \"null\" * \"bool\" * \"int8\" / \"uint8\" * \"int16\" / \"uint16\" * \"int32\" / \"uint32\" * \"int64\" / \"uint64\" * \"halffloat\" / \"float\" / \"double\" * \"string\" / \"large_string\" * \"binary\" / \"large_binary\" * \"date32:day\" * \"date64:ms\" * \"decimal:128:{precision}:{scale}\" / \"decimal:256:{precision}:{scale}\" * \"time:{unit}\" / \"timestamp:{unit}\" / \"duration:{unit}\", where unit is \"s\", \"ms\", \"us\", \"ns\" * \"dict:{value_type}:{index_type}:false\"
+ #[serde(rename = "logicalType")]
+ pub logical_type: String,
+ #[serde(rename = "nullable", skip_serializing_if = "Option::is_none")]
+ pub nullable: Option,
+ /// optional field metadata (e.g. extension type name/parameters)
+ #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
+ pub metadata: Option>,
+}
+
+impl Field {
+ pub fn new(r#type: Type, name: String, id: models::Int, logical_type: String) -> Field {
+ Field {
+ r#type,
+ name,
+ id,
+ parent_id: None,
+ logical_type,
+ nullable: None,
+ metadata: None,
+ }
+ }
+}
+///
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
+pub enum Type {
+ #[serde(rename = "PARENT")]
+ Parent,
+ #[serde(rename = "REPEATED")]
+ Repeated,
+ #[serde(rename = "LEAF")]
+ Leaf,
+}
+
+impl Default for Type {
+ fn default() -> Type {
+ Self::Parent
+ }
+}
+
diff --git a/rust/lance-catalog-reqwest-client/src/models/mod.rs b/rust/lance-catalog-reqwest-client/src/models/mod.rs
index 8f04e336..0d63b88e 100644
--- a/rust/lance-catalog-reqwest-client/src/models/mod.rs
+++ b/rust/lance-catalog-reqwest-client/src/models/mod.rs
@@ -2,8 +2,12 @@ pub mod create_namespace_request;
pub use self::create_namespace_request::CreateNamespaceRequest;
pub mod create_namespace_response;
pub use self::create_namespace_response::CreateNamespaceResponse;
+pub mod create_table_request;
+pub use self::create_table_request::CreateTableRequest;
pub mod error_response;
pub use self::error_response::ErrorResponse;
+pub mod field;
+pub use self::field::Field;
pub mod get_namespace_response;
pub use self::get_namespace_response::GetNamespaceResponse;
pub mod get_table_response;
@@ -12,3 +16,7 @@ pub mod list_namespaces_response;
pub use self::list_namespaces_response::ListNamespacesResponse;
pub mod register_table_request;
pub use self::register_table_request::RegisterTableRequest;
+pub mod schema;
+pub use self::schema::Schema;
+pub mod writer_version;
+pub use self::writer_version::WriterVersion;
diff --git a/rust/lance-catalog-reqwest-client/src/models/schema.rs b/rust/lance-catalog-reqwest-client/src/models/schema.rs
new file mode 100644
index 00000000..f2f19d38
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/src/models/schema.rs
@@ -0,0 +1,30 @@
+/*
+ * Lance Catalog REST Specification
+ *
+ * **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct Schema {
+ #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
+ pub metadata: Option>,
+ #[serde(rename = "fields")]
+ pub fields: Vec,
+}
+
+impl Schema {
+ pub fn new(fields: Vec) -> Schema {
+ Schema {
+ metadata: None,
+ fields,
+ }
+ }
+}
+
diff --git a/rust/lance-catalog-reqwest-client/src/models/writer_version.rs b/rust/lance-catalog-reqwest-client/src/models/writer_version.rs
new file mode 100644
index 00000000..3c1f4b25
--- /dev/null
+++ b/rust/lance-catalog-reqwest-client/src/models/writer_version.rs
@@ -0,0 +1,32 @@
+/*
+ * Lance Catalog REST Specification
+ *
+ * **Lance Catalog** is an OpenAPI specification on top of the storage-based Lance format. It provides an integration point for catalog service like Apache Hive MetaStore (HMS), Apache Gravitino, etc. to store and use Lance tables. To integrate, the catalog service implements a **Lance Catalog Adapter**, which is a REST server that converts the Lance catalog requests to native requests against the catalog service. Different tools can integrate with Lance Catalog using the generated OpenAPI clients in various languages, and invoke operations in Lance Catalog to read, write and manage Lance tables in the integrated catalog services.
+ *
+ * The version of the OpenAPI document: 0.0.1
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct WriterVersion {
+ /// The name of the library that created this file.
+ #[serde(rename = "library", skip_serializing_if = "Option::is_none")]
+ pub library: Option,
+ /// The version of the library that created this file. Because we cannot assume that the library is semantically versioned, this is a string. However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix. For example: `2.0.0`, `2.0.0-rc.1`.
+ #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
+ pub version: Option,
+}
+
+impl WriterVersion {
+ pub fn new() -> WriterVersion {
+ WriterVersion {
+ library: None,
+ version: None,
+ }
+ }
+}
+
diff --git a/spec/catalog.yaml b/spec/catalog.yaml
index c8f29a87..2ae48b01 100644
--- a/spec/catalog.yaml
+++ b/spec/catalog.yaml
@@ -213,6 +213,50 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'
+ /v1/namespaces/{ns}/tables:
+ parameters:
+ - $ref: '#/components/parameters/namespace'
+
+ post:
+ tags: [ Table ]
+ summary: Create a table in the catalog
+ operationId: CreateTable
+ description: >
+ Create a new Lance table in the catalog.
+
+ There are three modes when trying to create a table:
+ * CREATE: Create the table if it does not exist. If a table of the same name already exists, the operation fails with 400.
+ * EXIST_OK: Create the table if it does not exist. If a table of the same name already exists, the operation succeeds and the existing table is kept.
+ * OVERWRITE: Create the table if it does not exist. If a table of the same name already exists, the existing table and all data is dropped and a new table with this name with no data is created.
+
+ The server might create the table using a library and writer version that is different from the one in the user environment.
+ The server is responsible for rejecting the request if the table created by the server cannot be properly used
+ by the client library and writer version.
+
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateTableRequest'
+ responses:
+ 200:
+ $ref: '#/components/responses/GetTableResponse'
+ 400:
+ $ref: '#/components/responses/BadRequestErrorResponse'
+ 401:
+ $ref: '#/components/responses/UnauthorizedErrorResponse'
+ 403:
+ $ref: '#/components/responses/ForbiddenErrorResponse'
+ 406:
+ $ref: '#/components/responses/UnsupportedOperationErrorResponse'
+ 409:
+ $ref: '#/components/responses/ConflictErrorResponse'
+ 503:
+ $ref: '#/components/responses/ServiceUnavailableErrorResponse'
+ 5XX:
+ $ref: '#/components/responses/ServerErrorResponse'
+
/v1/namespaces/{ns}/tables/{table}:
parameters:
- $ref: '#/components/parameters/namespace'
@@ -418,6 +462,132 @@ components:
location:
type: string
+ Schema:
+ type: object
+ required:
+ - fields
+ properties:
+ metadata:
+ type: object
+ additionalProperties:
+ type: string
+ fields:
+ type: array
+ uniqueItems: true
+ items:
+ $ref: '#/components/schemas/Field'
+
+ Field:
+ type: object
+ required:
+ - type
+ - name
+ - id
+ - logicalType
+ properties:
+ type:
+ type: string
+ enum:
+ - PARENT
+ - REPEATED
+ - LEAF
+ name:
+ type: string
+ id:
+ type: int
+ parentId:
+ type: int
+ logicalType:
+ type: string
+ description: >
+ Logical types, currently support parameterized Arrow Type.
+
+ PARENT types will always have logical type "struct".
+
+ Logical type "map" is represented as a struct with a single child field "entries".
+ "entries" is a struct with fields "key" and "value".
+
+ REPEATED types may have logical types:
+ * "list"
+ * "large_list"
+ * "list.struct"
+ * "large_list.struct"
+ The final two are used if the list values are structs, and therefore the
+ field is both implicitly REPEATED and PARENT.
+
+ LEAF types may have logical types:
+ * "null"
+ * "bool"
+ * "int8" / "uint8"
+ * "int16" / "uint16"
+ * "int32" / "uint32"
+ * "int64" / "uint64"
+ * "halffloat" / "float" / "double"
+ * "string" / "large_string"
+ * "binary" / "large_binary"
+ * "date32:day"
+ * "date64:ms"
+ * "decimal:128:{precision}:{scale}" / "decimal:256:{precision}:{scale}"
+ * "time:{unit}" / "timestamp:{unit}" / "duration:{unit}", where unit is "s", "ms", "us", "ns"
+ * "dict:{value_type}:{index_type}:false"
+ nullable:
+ type: boolean
+ metadata:
+ type: object
+ description: optional field metadata (e.g. extension type name/parameters)
+ additionalProperties:
+ type: string
+
+ WriterVersion:
+ type: object
+ properties:
+ library:
+ type: string
+ description: The name of the library that created this file.
+ version:
+ type: string
+ description: >
+ The version of the library that created this file.
+ Because we cannot assume that the library is semantically versioned, this is a string.
+ However, if it is semantically versioned, it should be a valid semver string without any 'v' prefix.
+ For example: `2.0.0`, `2.0.0-rc.1`.
+
+ CreateTableRequest:
+ type: object
+ required:
+ - name
+ - schema
+ properties:
+ name:
+ type: string
+ mode:
+ type: string
+ enum:
+ - CREATE
+ - EXIST_OK
+ - OVERWRITE
+ default: CREATE
+ type:
+ type: string
+ enum:
+ - STORAGE_MANAGED
+ - CATALOG_MANAGED
+ default: STORAGE_MANAGED
+ location:
+ type: string
+ schema:
+ $ref: '#/components/schemas/Schema'
+ writerVersion:
+ $ref: '#/components/schemas/WriterVersion'
+ config:
+ type: object
+ description: >
+ optional configurations for the table.
+ Keys with the prefix "lance." are reserved for the Lance library.
+ Other libraries may wish to similarly prefix their configuration keys appropriately.
+ additionalProperties:
+ type: string
+
GetTableResponse:
description: |
Result used when a table is successfully loaded.