Skip to content

Commit 59754f7

Browse files
authored
spec: register table (#22)
1 parent b67ddf2 commit 59754f7

38 files changed

Lines changed: 2409 additions & 0 deletions

File tree

java/lance-catalog-apache-client/.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ docs/CreateNamespaceRequest.md
55
docs/CreateNamespaceResponse.md
66
docs/ErrorModel.md
77
docs/GetNamespaceResponse.md
8+
docs/GetTableResponse.md
89
docs/ListNamespacesResponse.md
910
docs/NamespaceApi.md
11+
docs/RegisterTableRequest.md
12+
docs/TableApi.md
1013
pom.xml
1114
src/main/AndroidManifest.xml
1215
src/main/java/com/lancedb/lance/catalog/client/apache/ApiClient.java
@@ -20,6 +23,7 @@ src/main/java/com/lancedb/lance/catalog/client/apache/ServerConfiguration.java
2023
src/main/java/com/lancedb/lance/catalog/client/apache/ServerVariable.java
2124
src/main/java/com/lancedb/lance/catalog/client/apache/StringUtil.java
2225
src/main/java/com/lancedb/lance/catalog/client/apache/api/NamespaceApi.java
26+
src/main/java/com/lancedb/lance/catalog/client/apache/api/TableApi.java
2327
src/main/java/com/lancedb/lance/catalog/client/apache/auth/ApiKeyAuth.java
2428
src/main/java/com/lancedb/lance/catalog/client/apache/auth/Authentication.java
2529
src/main/java/com/lancedb/lance/catalog/client/apache/auth/HttpBasicAuth.java
@@ -28,4 +32,6 @@ src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateNamespaceReque
2832
src/main/java/com/lancedb/lance/catalog/client/apache/model/CreateNamespaceResponse.java
2933
src/main/java/com/lancedb/lance/catalog/client/apache/model/ErrorModel.java
3034
src/main/java/com/lancedb/lance/catalog/client/apache/model/GetNamespaceResponse.java
35+
src/main/java/com/lancedb/lance/catalog/client/apache/model/GetTableResponse.java
3136
src/main/java/com/lancedb/lance/catalog/client/apache/model/ListNamespacesResponse.java
37+
src/main/java/com/lancedb/lance/catalog/client/apache/model/RegisterTableRequest.java

java/lance-catalog-apache-client/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Class | Method | HTTP request | Description
119119
*NamespaceApi* | [**getNamespace**](docs/NamespaceApi.md#getNamespace) | **GET** /v1/namespaces/{ns} | Get information about a namespace
120120
*NamespaceApi* | [**listNamespaces**](docs/NamespaceApi.md#listNamespaces) | **GET** /v1/namespaces | List all namespaces in the catalog.
121121
*NamespaceApi* | [**namespaceExists**](docs/NamespaceApi.md#namespaceExists) | **HEAD** /v1/namespaces/{ns} | Check if a namespace exists
122+
*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.
122123

123124

124125
## Documentation for Models
@@ -127,7 +128,9 @@ Class | Method | HTTP request | Description
127128
- [CreateNamespaceResponse](docs/CreateNamespaceResponse.md)
128129
- [ErrorModel](docs/ErrorModel.md)
129130
- [GetNamespaceResponse](docs/GetNamespaceResponse.md)
131+
- [GetTableResponse](docs/GetTableResponse.md)
130132
- [ListNamespacesResponse](docs/ListNamespacesResponse.md)
133+
- [RegisterTableRequest](docs/RegisterTableRequest.md)
131134

132135

133136
<a id="documentation-for-authorization"></a>

java/lance-catalog-apache-client/api/openapi.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,39 @@ paths:
174174
- application/json
175175
parameters:
176176
- $ref: '#/components/parameters/namespace'
177+
/v1/namespaces/{ns}/register:
178+
post:
179+
operationId: RegisterTable
180+
parameters:
181+
- $ref: '#/components/parameters/namespace'
182+
requestBody:
183+
content:
184+
application/json:
185+
schema:
186+
$ref: '#/components/schemas/RegisterTableRequest'
187+
required: true
188+
responses:
189+
"200":
190+
$ref: '#/components/responses/GetTableResponse'
191+
"400":
192+
$ref: '#/components/responses/BadRequestErrorResponse'
193+
"401":
194+
$ref: '#/components/responses/UnauthorizedResponse'
195+
"403":
196+
$ref: '#/components/responses/ForbiddenResponse'
197+
"406":
198+
$ref: '#/components/responses/UnsupportedOperationResponse'
199+
"503":
200+
$ref: '#/components/responses/ServiceUnavailableResponse'
201+
"5XX":
202+
$ref: '#/components/responses/ServerErrorResponse'
203+
summary: |
204+
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.
205+
tags:
206+
- Table
207+
x-content-type: application/json
208+
x-accepts:
209+
- application/json
177210
components:
178211
examples:
179212
ListNamespacesEmptyExample:
@@ -249,6 +282,12 @@ components:
249282
$ref: '#/components/schemas/GetNamespaceResponse'
250283
description: "Returns a namespace, as well as any properties stored on the namespace\
251284
\ if namespace properties are supported by the server."
285+
GetTableResponse:
286+
content:
287+
application/json:
288+
schema:
289+
$ref: '#/components/schemas/GetTableResponse'
290+
description: Table properties result when loading a table
252291
BadRequestErrorResponse:
253292
content:
254293
application/json:
@@ -471,4 +510,35 @@ components:
471510
Clients must interpret either `null`, missing value or empty string value of `nextPageToken` from a server response as the end of the listing results.
472511
type: string
473512
nullable: true
513+
RegisterTableRequest:
514+
example:
515+
name: name
516+
location: location
517+
properties:
518+
name:
519+
type: string
520+
location:
521+
type: string
522+
required:
523+
- location
524+
- name
525+
GetTableResponse:
526+
description: |
527+
Result used when a table is successfully loaded.
528+
example:
529+
name: name
530+
location: location
531+
properties:
532+
key: properties
533+
properties:
534+
name:
535+
type: string
536+
location:
537+
type: string
538+
properties:
539+
additionalProperties:
540+
type: string
541+
required:
542+
- location
543+
- name
474544

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# GetTableResponse
4+
5+
Result used when a table is successfully loaded.
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**name** | **String** | | |
12+
|**location** | **String** | | |
13+
|**properties** | **Map&lt;String, String&gt;** | | [optional] |
14+
15+
16+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
# RegisterTableRequest
4+
5+
6+
## Properties
7+
8+
| Name | Type | Description | Notes |
9+
|------------ | ------------- | ------------- | -------------|
10+
|**name** | **String** | | |
11+
|**location** | **String** | | |
12+
13+
14+
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# TableApi
2+
3+
All URIs are relative to *http://localhost:2333*
4+
5+
| Method | HTTP request | Description |
6+
|------------- | ------------- | -------------|
7+
| [**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. |
8+
9+
10+
11+
## registerTable
12+
13+
> GetTableResponse registerTable(ns, registerTableRequest)
14+
15+
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.
16+
17+
### Example
18+
19+
```java
20+
// Import classes:
21+
import com.lancedb.lance.catalog.client.apache.ApiClient;
22+
import com.lancedb.lance.catalog.client.apache.ApiException;
23+
import com.lancedb.lance.catalog.client.apache.Configuration;
24+
import com.lancedb.lance.catalog.client.apache.models.*;
25+
import com.lancedb.lance.catalog.client.apache.api.TableApi;
26+
27+
public class Example {
28+
public static void main(String[] args) {
29+
ApiClient defaultClient = Configuration.getDefaultApiClient();
30+
defaultClient.setBasePath("http://localhost:2333");
31+
32+
TableApi apiInstance = new TableApi(defaultClient);
33+
String ns = "ns_example"; // String | The name of the namespace.
34+
RegisterTableRequest registerTableRequest = new RegisterTableRequest(); // RegisterTableRequest |
35+
try {
36+
GetTableResponse result = apiInstance.registerTable(ns, registerTableRequest);
37+
System.out.println(result);
38+
} catch (ApiException e) {
39+
System.err.println("Exception when calling TableApi#registerTable");
40+
System.err.println("Status code: " + e.getCode());
41+
System.err.println("Reason: " + e.getResponseBody());
42+
System.err.println("Response headers: " + e.getResponseHeaders());
43+
e.printStackTrace();
44+
}
45+
}
46+
}
47+
```
48+
49+
### Parameters
50+
51+
52+
| Name | Type | Description | Notes |
53+
|------------- | ------------- | ------------- | -------------|
54+
| **ns** | **String**| The name of the namespace. | |
55+
| **registerTableRequest** | [**RegisterTableRequest**](RegisterTableRequest.md)| | |
56+
57+
### Return type
58+
59+
[**GetTableResponse**](GetTableResponse.md)
60+
61+
### Authorization
62+
63+
No authorization required
64+
65+
### HTTP request headers
66+
67+
- **Content-Type**: application/json
68+
- **Accept**: application/json
69+
70+
71+
### HTTP response details
72+
| Status code | Description | Response headers |
73+
|-------------|-------------|------------------|
74+
| **200** | Table properties result when loading a table | - |
75+
| **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&#39;s middleware. | - |
76+
| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - |
77+
| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - |
78+
| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - |
79+
| **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. | - |
80+
| **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. | - |
81+

0 commit comments

Comments
 (0)