Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

import com.lancedb.lance.namespace.server.springboot.model.AlterTransactionResponse;
import com.lancedb.lance.namespace.server.springboot.model.CreateNamespaceResponse;
import com.lancedb.lance.namespace.server.springboot.model.DeregisterTableResponse;
import com.lancedb.lance.namespace.server.springboot.model.DropNamespaceResponse;
import com.lancedb.lance.namespace.server.springboot.model.DropTableResponse;
import com.lancedb.lance.namespace.server.springboot.model.GetNamespaceResponse;
import com.lancedb.lance.namespace.server.springboot.model.GetTableResponse;
import com.lancedb.lance.namespace.server.springboot.model.GetTransactionResponse;
Expand Down Expand Up @@ -94,6 +96,27 @@ public static TableExistsResponse tableExists(
return converted;
}

public static DropTableResponse dropTable(
com.lancedb.lance.namespace.model.DropTableResponse response) {
DropTableResponse converted = new DropTableResponse();
converted.setName(response.getName());
converted.setNamespace(response.getNamespace());
converted.setLocation(response.getLocation());
converted.setProperties(response.getProperties());
converted.setTransactionId(response.getTransactionId());
return converted;
}

public static DeregisterTableResponse deregisterTable(
com.lancedb.lance.namespace.model.DeregisterTableResponse response) {
DeregisterTableResponse converted = new DeregisterTableResponse();
converted.setName(response.getName());
converted.setNamespace(response.getNamespace());
converted.setLocation(response.getLocation());
converted.setProperties(response.getProperties());
return converted;
}

public static GetTransactionResponse getTransaction(
com.lancedb.lance.namespace.model.GetTransactionResponse response) {
GetTransactionResponse converted = new GetTransactionResponse();
Expand All @@ -108,7 +131,6 @@ public static AlterTransactionResponse alterTransaction(
AlterTransactionResponse converted = new AlterTransactionResponse();
converted.setId(response.getId());
converted.setStatus(TransactionStatus.valueOf(response.getStatus().name()));
converted.setProperties(response.getProperties());
return converted;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import com.lancedb.lance.namespace.model.AlterTransactionSetStatus;
import com.lancedb.lance.namespace.model.AlterTransactionUnsetProperty;
import com.lancedb.lance.namespace.model.CreateNamespaceRequest;
import com.lancedb.lance.namespace.model.DeregisterTableRequest;
import com.lancedb.lance.namespace.model.DropNamespaceRequest;
import com.lancedb.lance.namespace.model.DropTableRequest;
import com.lancedb.lance.namespace.model.GetNamespaceRequest;
import com.lancedb.lance.namespace.model.GetTableRequest;
import com.lancedb.lance.namespace.model.GetTransactionRequest;
Expand Down Expand Up @@ -99,6 +101,22 @@ public static TableExistsRequest tableExists(
return converted;
}

public static DropTableRequest dropTable(
com.lancedb.lance.namespace.server.springboot.model.DropTableRequest request) {
DropTableRequest converted = new DropTableRequest();
converted.setName(request.getName());
converted.setNamespace(request.getNamespace());
return converted;
}

public static DeregisterTableRequest deregisterTable(
com.lancedb.lance.namespace.server.springboot.model.DeregisterTableRequest request) {
DeregisterTableRequest converted = new DeregisterTableRequest();
converted.setName(request.getName());
converted.setNamespace(request.getNamespace());
return converted;
}

public static GetTransactionRequest getTransaction(
com.lancedb.lance.namespace.server.springboot.model.GetTransactionRequest request) {
GetTransactionRequest converted = new GetTransactionRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

import com.lancedb.lance.namespace.LanceNamespace;
import com.lancedb.lance.namespace.server.springboot.api.TableApi;
import com.lancedb.lance.namespace.server.springboot.model.DeregisterTableRequest;
import com.lancedb.lance.namespace.server.springboot.model.DeregisterTableResponse;
import com.lancedb.lance.namespace.server.springboot.model.DropTableRequest;
import com.lancedb.lance.namespace.server.springboot.model.DropTableResponse;
import com.lancedb.lance.namespace.server.springboot.model.GetTableRequest;
import com.lancedb.lance.namespace.server.springboot.model.GetTableResponse;
import com.lancedb.lance.namespace.server.springboot.model.RegisterTableRequest;
Expand Down Expand Up @@ -55,4 +59,20 @@ public ResponseEntity<TableExistsResponse> tableExists(TableExistsRequest tableE
ClientToServerResponse.tableExists(
delegate.tableExists(ServerToClientRequest.tableExists(tableExistsRequest))));
}

@Override
public ResponseEntity<DropTableResponse> dropTable(DropTableRequest dropTableRequest) {
return ResponseEntity.ok(
ClientToServerResponse.dropTable(
delegate.dropTable(ServerToClientRequest.dropTable(dropTableRequest))));
}

@Override
public ResponseEntity<DeregisterTableResponse> deregisterTable(
DeregisterTableRequest deregisterTableRequest) {
return ResponseEntity.ok(
ClientToServerResponse.deregisterTable(
delegate.deregisterTable(
ServerToClientRequest.deregisterTable(deregisterTableRequest))));
}
}
6 changes: 6 additions & 0 deletions java/lance-namespace-apache-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Class | Method | HTTP request | Description
*NamespaceApi* | [**getNamespace**](docs/NamespaceApi.md#getNamespace) | **POST** /GetNamespace | Get information about a namespace
*NamespaceApi* | [**listNamespaces**](docs/NamespaceApi.md#listNamespaces) | **POST** /ListNamespaces | List namespaces
*NamespaceApi* | [**namespaceExists**](docs/NamespaceApi.md#namespaceExists) | **POST** /NamespaceExists | Check if a namespace exists
*TableApi* | [**deregisterTable**](docs/TableApi.md#deregisterTable) | **POST** /DeregisterTable | Deregister a table from its namespace
*TableApi* | [**dropTable**](docs/TableApi.md#dropTable) | **POST** /DropTable | Drop a table from its namespace
*TableApi* | [**getTable**](docs/TableApi.md#getTable) | **POST** /GetTable | Get a table from the namespace
*TableApi* | [**registerTable**](docs/TableApi.md#registerTable) | **POST** /RegisterTable | Register a table to a namespace
*TableApi* | [**tableExists**](docs/TableApi.md#tableExists) | **POST** /TableExists | Check if a table exists
Expand All @@ -133,8 +135,12 @@ Class | Method | HTTP request | Description
- [AlterTransactionUnsetProperty](docs/AlterTransactionUnsetProperty.md)
- [CreateNamespaceRequest](docs/CreateNamespaceRequest.md)
- [CreateNamespaceResponse](docs/CreateNamespaceResponse.md)
- [DeregisterTableRequest](docs/DeregisterTableRequest.md)
- [DeregisterTableResponse](docs/DeregisterTableResponse.md)
- [DropNamespaceRequest](docs/DropNamespaceRequest.md)
- [DropNamespaceResponse](docs/DropNamespaceResponse.md)
- [DropTableRequest](docs/DropTableRequest.md)
- [DropTableResponse](docs/DropTableResponse.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [GetNamespaceRequest](docs/GetNamespaceRequest.md)
- [GetNamespaceResponse](docs/GetNamespaceResponse.md)
Expand Down
154 changes: 150 additions & 4 deletions java/lance-namespace-apache-client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,70 @@ paths:
x-content-type: application/json
x-accepts:
- application/json
/DropTable:
post:
description: |
Drop a table from its namespace and delete its data. If the table and its data can be immediately deleted, return information of the deleted table. Otherwise, return a transaction ID that client can use to track deletion progress.
operationId: DropTable
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DropTableRequest'
required: true
responses:
"200":
$ref: '#/components/responses/DropTableResponse'
"400":
$ref: '#/components/responses/BadRequestErrorResponse'
"401":
$ref: '#/components/responses/UnauthorizedErrorResponse'
"403":
$ref: '#/components/responses/ForbiddenErrorResponse'
"404":
$ref: '#/components/responses/NotFoundErrorResponse'
"503":
$ref: '#/components/responses/ServiceUnavailableErrorResponse'
"5XX":
$ref: '#/components/responses/ServerErrorResponse'
summary: Drop a table from its namespace
tags:
- Table
x-content-type: application/json
x-accepts:
- application/json
/DeregisterTable:
post:
description: |
Deregister a table from its namespace. The table content remains available in the storage.
operationId: DeregisterTable
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DeregisterTableRequest'
required: true
responses:
"200":
$ref: '#/components/responses/DeregisterTableResponse'
"400":
$ref: '#/components/responses/BadRequestErrorResponse'
"401":
$ref: '#/components/responses/UnauthorizedErrorResponse'
"403":
$ref: '#/components/responses/ForbiddenErrorResponse'
"404":
$ref: '#/components/responses/NotFoundErrorResponse'
"503":
$ref: '#/components/responses/ServiceUnavailableErrorResponse'
"5XX":
$ref: '#/components/responses/ServerErrorResponse'
summary: Deregister a table from its namespace
tags:
- Table
x-content-type: application/json
x-accepts:
- application/json
components:
examples:
ListNamespacesEmptyExample:
Expand Down Expand Up @@ -444,6 +508,18 @@ components:
schema:
$ref: '#/components/schemas/AlterTransactionResponse'
description: Response of AlterTransaction
DropTableResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/DropTableResponse'
description: Response of DropTable
DeregisterTableResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/DeregisterTableResponse'
description: Response of DeregisterTable
BadRequestErrorResponse:
content:
application/json:
Expand Down Expand Up @@ -1056,18 +1132,88 @@ components:
AlterTransactionResponse:
example:
id: id
properties:
key: properties
status: QUEUED
properties:
id:
type: string
status:
$ref: '#/components/schemas/TransactionStatus'
required:
- id
- status
DropTableRequest:
example:
name: name
namespace:
- namespace
- namespace
properties:
name:
type: string
namespace:
items:
type: string
type: array
required:
- name
DropTableResponse:
example:
name: name
namespace:
- namespace
- namespace
location: location
properties:
key: properties
transactionId: transactionId
properties:
name:
type: string
namespace:
items:
type: string
type: array
location:
type: string
properties:
additionalProperties:
type: string
transactionId:
type: string
DeregisterTableRequest:
example:
name: name
namespace:
- namespace
- namespace
properties:
name:
type: string
namespace:
items:
type: string
type: array
required:
- id
- status
- name
DeregisterTableResponse:
example:
name: name
namespace:
- namespace
- namespace
location: location
properties:
key: properties
properties:
name:
type: string
namespace:
items:
type: string
type: array
location:
type: string
properties:
additionalProperties:
type: string

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
|------------ | ------------- | ------------- | -------------|
|**id** | **String** | | |
|**status** | **TransactionStatus** | | |
|**properties** | **Map&lt;String, String&gt;** | | [optional] |



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


# DeregisterTableRequest


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | |
|**namespace** | **List&lt;String&gt;** | | [optional] |



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


# DeregisterTableResponse


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |
|**namespace** | **List&lt;String&gt;** | | [optional] |
|**location** | **String** | | [optional] |
|**properties** | **Map&lt;String, String&gt;** | | [optional] |



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


# DropTableRequest


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | |
|**namespace** | **List&lt;String&gt;** | | [optional] |



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


# DropTableResponse


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | | [optional] |
|**namespace** | **List&lt;String&gt;** | | [optional] |
|**location** | **String** | | [optional] |
|**properties** | **Map&lt;String, String&gt;** | | [optional] |
|**transactionId** | **String** | | [optional] |



Loading