Skip to content

Commit 0a76dc2

Browse files
committed
address review comments
1 parent 31fbc33 commit 0a76dc2

8 files changed

Lines changed: 103 additions & 8 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,15 @@ components:
477477
description: |
478478
Result used when a table is successfully loaded.
479479
example:
480+
location: location
480481
properties:
481482
key: properties
482483
properties:
484+
location:
485+
type: string
483486
properties:
484487
additionalProperties:
485488
type: string
489+
required:
490+
- location
486491

java/lance-catalog-apache-client/docs/GetTableResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Result used when a table is successfully loaded.
88

99
| Name | Type | Description | Notes |
1010
|------------ | ------------- | ------------- | -------------|
11+
|**location** | **String** | | |
1112
|**properties** | **Map<String, String>** | | [optional] |
1213

1314

java/lance-catalog-apache-client/src/main/java/com/lancedb/lance/catalog/client/apache/model/GetTableResponse.java

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,46 @@
2525
import java.util.StringJoiner;
2626

2727
/** Result used when a table is successfully loaded. */
28-
@JsonPropertyOrder({GetTableResponse.JSON_PROPERTY_PROPERTIES})
28+
@JsonPropertyOrder({
29+
GetTableResponse.JSON_PROPERTY_LOCATION,
30+
GetTableResponse.JSON_PROPERTY_PROPERTIES
31+
})
2932
@javax.annotation.Generated(
3033
value = "org.openapitools.codegen.languages.JavaClientCodegen",
3134
comments = "Generator version: 7.12.0")
3235
public class GetTableResponse {
36+
public static final String JSON_PROPERTY_LOCATION = "location";
37+
@javax.annotation.Nonnull private String location;
38+
3339
public static final String JSON_PROPERTY_PROPERTIES = "properties";
3440
@javax.annotation.Nullable private Map<String, String> properties = new HashMap<>();
3541

3642
public GetTableResponse() {}
3743

44+
public GetTableResponse location(@javax.annotation.Nonnull String location) {
45+
46+
this.location = location;
47+
return this;
48+
}
49+
50+
/**
51+
* Get location
52+
*
53+
* @return location
54+
*/
55+
@javax.annotation.Nonnull
56+
@JsonProperty(JSON_PROPERTY_LOCATION)
57+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
58+
public String getLocation() {
59+
return location;
60+
}
61+
62+
@JsonProperty(JSON_PROPERTY_LOCATION)
63+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
64+
public void setLocation(@javax.annotation.Nonnull String location) {
65+
this.location = location;
66+
}
67+
3868
public GetTableResponse properties(@javax.annotation.Nullable Map<String, String> properties) {
3969

4070
this.properties = properties;
@@ -76,18 +106,20 @@ public boolean equals(Object o) {
76106
return false;
77107
}
78108
GetTableResponse getTableResponse = (GetTableResponse) o;
79-
return Objects.equals(this.properties, getTableResponse.properties);
109+
return Objects.equals(this.location, getTableResponse.location)
110+
&& Objects.equals(this.properties, getTableResponse.properties);
80111
}
81112

82113
@Override
83114
public int hashCode() {
84-
return Objects.hash(properties);
115+
return Objects.hash(location, properties);
85116
}
86117

87118
@Override
88119
public String toString() {
89120
StringBuilder sb = new StringBuilder();
90121
sb.append("class GetTableResponse {\n");
122+
sb.append(" location: ").append(toIndentedString(location)).append("\n");
91123
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
92124
sb.append("}");
93125
return sb.toString();
@@ -135,6 +167,22 @@ public String toUrlQueryString(String prefix) {
135167

136168
StringJoiner joiner = new StringJoiner("&");
137169

170+
// add `location` to the URL query string
171+
if (getLocation() != null) {
172+
try {
173+
joiner.add(
174+
String.format(
175+
"%slocation%s=%s",
176+
prefix,
177+
suffix,
178+
URLEncoder.encode(String.valueOf(getLocation()), "UTF-8")
179+
.replaceAll("\\+", "%20")));
180+
} catch (UnsupportedEncodingException e) {
181+
// Should never happen, UTF-8 is always supported
182+
throw new RuntimeException(e);
183+
}
184+
}
185+
138186
// add `properties` to the URL query string
139187
if (getProperties() != null) {
140188
for (String _key : getProperties().keySet()) {

java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/api/NamespaceApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ default ResponseEntity<GetTableResponse> getTable(
592592
request -> {
593593
for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) {
594594
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
595-
String exampleString = "{ \"properties\" : { \"key\" : \"properties\" } }";
595+
String exampleString =
596+
"{ \"location\" : \"location\", \"properties\" : { \"key\" : \"properties\" } }";
596597
ApiUtil.setExampleResponse(request, "application/json", exampleString);
597598
break;
598599
}

java/lance-catalog-springboot-server/src/main/java/com/lancedb/lance/catalog/server/springboot/model/GetTableResponse.java

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,40 @@
3434
comments = "Generator version: 7.12.0")
3535
public class GetTableResponse {
3636

37+
private String location;
38+
3739
@Valid private Map<String, String> properties = new HashMap<>();
3840

41+
public GetTableResponse() {
42+
super();
43+
}
44+
45+
/** Constructor with only required parameters */
46+
public GetTableResponse(String location) {
47+
this.location = location;
48+
}
49+
50+
public GetTableResponse location(String location) {
51+
this.location = location;
52+
return this;
53+
}
54+
55+
/**
56+
* Get location
57+
*
58+
* @return location
59+
*/
60+
@NotNull
61+
@Schema(name = "location", requiredMode = Schema.RequiredMode.REQUIRED)
62+
@JsonProperty("location")
63+
public String getLocation() {
64+
return location;
65+
}
66+
67+
public void setLocation(String location) {
68+
this.location = location;
69+
}
70+
3971
public GetTableResponse properties(Map<String, String> properties) {
4072
this.properties = properties;
4173
return this;
@@ -73,18 +105,20 @@ public boolean equals(Object o) {
73105
return false;
74106
}
75107
GetTableResponse getTableResponse = (GetTableResponse) o;
76-
return Objects.equals(this.properties, getTableResponse.properties);
108+
return Objects.equals(this.location, getTableResponse.location)
109+
&& Objects.equals(this.properties, getTableResponse.properties);
77110
}
78111

79112
@Override
80113
public int hashCode() {
81-
return Objects.hash(properties);
114+
return Objects.hash(location, properties);
82115
}
83116

84117
@Override
85118
public String toString() {
86119
StringBuilder sb = new StringBuilder();
87120
sb.append("class GetTableResponse {\n");
121+
sb.append(" location: ").append(toIndentedString(location)).append("\n");
88122
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
89123
sb.append("}");
90124
return sb.toString();

rust/lance-catalog-reqwest-client/docs/GetTableResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7+
**location** | **String** | |
78
**properties** | Option<**std::collections::HashMap<String, String>**> | | [optional]
89

910
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

rust/lance-catalog-reqwest-client/src/models/get_table_response.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ use serde::{Deserialize, Serialize};
1414
/// GetTableResponse : Result used when a table is successfully loaded.
1515
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
1616
pub struct GetTableResponse {
17+
#[serde(rename = "location")]
18+
pub location: String,
1719
#[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
1820
pub properties: Option<std::collections::HashMap<String, String>>,
1921
}
2022

2123
impl GetTableResponse {
2224
/// Result used when a table is successfully loaded.
23-
pub fn new() -> GetTableResponse {
25+
pub fn new(location: String) -> GetTableResponse {
2426
GetTableResponse {
27+
location,
2528
properties: None,
2629
}
2730
}

spec/catalog.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,10 @@ components:
310310
Result used when a table is successfully loaded.
311311
type: object
312312
required:
313-
- metadata
313+
- location
314314
properties:
315+
location:
316+
type: string
315317
properties:
316318
type: object
317319
additionalProperties:

0 commit comments

Comments
 (0)