Skip to content

[SPEC] Add location keyword for GenericTable API #1543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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 @@ -1468,11 +1468,12 @@ public void testCreateGenericTableWithReservedProperty() {
Map.of("cat", currentCatalogName, "ns", ns))
.post(
Entity.json(
new CreateGenericTableRequest(
tableIdentifier.name(),
"format",
"doc",
Map.of("polaris.reserved", "true"))))) {
CreateGenericTableRequest.builder()
.setName(tableIdentifier.name())
.setFormat("format")
.setDoc("doc")
.setProperties(Map.of("polaris.reserved", "true"))
.build()))) {
Assertions.assertThat(res.getStatus()).isEqualTo(Response.Status.BAD_REQUEST.getStatusCode());
Assertions.assertThat(res.readEntity(String.class)).contains("reserved prefix");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@ public class CreateGenericTableRESTRequest extends CreateGenericTableRequest
public CreateGenericTableRESTRequest(
@JsonProperty(value = "name", required = true) String name,
@JsonProperty(value = "format", required = true) String format,
@JsonProperty(value = "location") String location,
@JsonProperty(value = "doc") String doc,
@JsonProperty(value = "properties") Map<String, String> properties) {
super(name, format, doc, properties);
super(name, format, location, doc, properties);
}

public CreateGenericTableRESTRequest(CreateGenericTableRequest request) {
this(request.getName(), request.getFormat(), request.getDoc(), request.getProperties());
this(
request.getName(),
request.getFormat(),
request.getLocation(),
request.getDoc(),
request.getProperties());
}

@Override
Expand Down
20 changes: 16 additions & 4 deletions spec/polaris-catalog-apis/generic-tables-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ components:
type: string
format:
type: string
location:
type: string
doc:
type: string
properties:
Expand All @@ -205,13 +207,21 @@ components:
description: >
Generic Table information.

- `name` name for the generic table
- `name`(REQUIRED): name for the generic table

- `format`(REQUIRED): format for the generic table, i.e. "delta", "csv"

- `format` format for the generic table, i.e. "delta", "csv"
- `location`(OPTIONAL): table root location in URI format. For example: s3://<my-bucket>/path/to/table.
- The table root location is a location that includes all files for the table.
- Clients (engines) are responsible to make sure all files are written under the configured location.
- A table with multiple root locations (i.e. containing files that are outside the configured root location) is not compliant with the current generic table support in Polaris.
- No two tables can have the same or overlapped location, otherwise, a ForbiddenException will be thrown on creation.
- If no location is provided, clients or users are responsible to manage the location and location related concerns such as path conflict etc.
- The location configuration can not be updated once the table is created.

- `properties` properties for the generic table passed on creation
- `properties`(OPTIONAL): properties for the generic table passed on creation

- `doc` comment or description for the generic table
- `doc`(OPTIONAL): comment or description for the generic table
required:
- name
- format
Expand All @@ -220,6 +230,8 @@ components:
type: string
format:
type: string
location:
type: string
doc:
type: string
properties:
Expand Down