Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions java/lance-catalog-apache-client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 5 additions & 0 deletions java/lance-catalog-apache-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)


<a id="documentation-for-authorization"></a>
Expand Down
187 changes: 187 additions & 0 deletions java/lance-catalog-apache-client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
38 changes: 38 additions & 0 deletions java/lance-catalog-apache-client/docs/CreateTableRequest.md
Original file line number Diff line number Diff line change
@@ -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&lt;String, String&gt;** | optional configurations for the table. Keys with the prefix \&quot;lance.\&quot; are reserved for the Lance library. Other libraries may wish to similarly prefix their configuration keys appropriately. | [optional] |



## Enum: ModeEnum

| Name | Value |
|---- | -----|
| CREATE | &quot;CREATE&quot; |
| EXIST_OK | &quot;EXIST_OK&quot; |
| OVERWRITE | &quot;OVERWRITE&quot; |



## Enum: TypeEnum

| Name | Value |
|---- | -----|
| STORAGE_MANAGED | &quot;STORAGE_MANAGED&quot; |
| CATALOG_MANAGED | &quot;CATALOG_MANAGED&quot; |



29 changes: 29 additions & 0 deletions java/lance-catalog-apache-client/docs/Field.md
Original file line number Diff line number Diff line change
@@ -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 \&quot;struct\&quot;. Logical type \&quot;map\&quot; is represented as a struct with a single child field \&quot;entries\&quot;. \&quot;entries\&quot; is a struct with fields \&quot;key\&quot; and \&quot;value\&quot;. REPEATED types may have logical types: * \&quot;list\&quot; * \&quot;large_list\&quot; * \&quot;list.struct\&quot; * \&quot;large_list.struct\&quot; 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: * \&quot;null\&quot; * \&quot;bool\&quot; * \&quot;int8\&quot; / \&quot;uint8\&quot; * \&quot;int16\&quot; / \&quot;uint16\&quot; * \&quot;int32\&quot; / \&quot;uint32\&quot; * \&quot;int64\&quot; / \&quot;uint64\&quot; * \&quot;halffloat\&quot; / \&quot;float\&quot; / \&quot;double\&quot; * \&quot;string\&quot; / \&quot;large_string\&quot; * \&quot;binary\&quot; / \&quot;large_binary\&quot; * \&quot;date32:day\&quot; * \&quot;date64:ms\&quot; * \&quot;decimal:128:{precision}:{scale}\&quot; / \&quot;decimal:256:{precision}:{scale}\&quot; * \&quot;time:{unit}\&quot; / \&quot;timestamp:{unit}\&quot; / \&quot;duration:{unit}\&quot;, where unit is \&quot;s\&quot;, \&quot;ms\&quot;, \&quot;us\&quot;, \&quot;ns\&quot; * \&quot;dict:{value_type}:{index_type}:false\&quot; | |
|**nullable** | **Boolean** | | [optional] |
|**metadata** | **Map&lt;String, String&gt;** | optional field metadata (e.g. extension type name/parameters) | [optional] |



## Enum: TypeEnum

| Name | Value |
|---- | -----|
| PARENT | &quot;PARENT&quot; |
| REPEATED | &quot;REPEATED&quot; |
| LEAF | &quot;LEAF&quot; |



14 changes: 14 additions & 0 deletions java/lance-catalog-apache-client/docs/Schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# Schema


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**metadata** | **Map&lt;String, String&gt;** | | [optional] |
|**fields** | [**Set&lt;Field&gt;**](Field.md) | | |



Loading
Loading