Skip to content

Commit f04b230

Browse files
committed
add change
1 parent 774cf34 commit f04b230

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogIntegrationTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,11 +1466,12 @@ public void testCreateGenericTableWithReservedProperty() {
14661466
Map.of("cat", currentCatalogName, "ns", ns))
14671467
.post(
14681468
Entity.json(
1469-
new CreateGenericTableRequest(
1470-
tableIdentifier.name(),
1471-
"format",
1472-
"doc",
1473-
Map.of("polaris.reserved", "true"))))) {
1469+
CreateGenericTableRequest.builder()
1470+
.setName(tableIdentifier.name())
1471+
.setFormat("format")
1472+
.setDoc("doc")
1473+
.setProperties(Map.of("polaris.reserved", "true"))
1474+
.build()))) {
14741475
Assertions.assertThat(res.getStatus()).isEqualTo(Response.Status.BAD_REQUEST.getStatusCode());
14751476
Assertions.assertThat(res.readEntity(String.class)).contains("reserved prefix");
14761477
}

plugins/spark/v3.5/spark/src/main/java/org/apache/polaris/spark/rest/CreateGenericTableRESTRequest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ public class CreateGenericTableRESTRequest extends CreateGenericTableRequest
3636
public CreateGenericTableRESTRequest(
3737
@JsonProperty(value = "name", required = true) String name,
3838
@JsonProperty(value = "format", required = true) String format,
39+
@JsonProperty(value = "location") String location,
3940
@JsonProperty(value = "doc") String doc,
4041
@JsonProperty(value = "properties") Map<String, String> properties) {
41-
super(name, format, doc, properties);
42+
super(name, format, location, doc, properties);
4243
}
4344

4445
public CreateGenericTableRESTRequest(CreateGenericTableRequest request) {
45-
this(request.getName(), request.getFormat(), request.getDoc(), request.getProperties());
46+
this(
47+
request.getName(),
48+
request.getFormat(),
49+
request.getLocation(),
50+
request.getDoc(),
51+
request.getProperties());
4652
}
4753

4854
@Override

spec/polaris-catalog-apis/generic-tables-api.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ components:
193193
type: string
194194
format:
195195
type: string
196+
location:
197+
type: string
196198
doc:
197199
type: string
198200
properties:
199201
type: object
200202
additionalProperties:
201203
type: string
202-
location:
203-
type: string
204204

205205
GenericTable:
206206
type: object
@@ -215,7 +215,7 @@ components:
215215
216216
- `doc` comment or description for the generic table
217217
218-
- `location` location for the table
218+
- `location` table root location in URI format. For example: s3://<my-bucket>/path/to/table
219219
required:
220220
- name
221221
- format
@@ -224,14 +224,14 @@ components:
224224
type: string
225225
format:
226226
type: string
227+
location:
228+
type: string
227229
doc:
228230
type: string
229231
properties:
230232
type: object
231233
additionalProperties:
232234
type: string
233-
location:
234-
type: string
235235

236236
LoadGenericTableResponse:
237237
description: Result used when a table is successfully loaded.

0 commit comments

Comments
 (0)