-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Core: Allow servers to express supported endpoints via endpoint field in ConfigResponse #10929
Conversation
18cedde
to
596b7eb
Compare
596b7eb
to
d343cbf
Compare
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
83adaf1
to
cca93fd
Compare
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
* resource path as defined in the Iceberg OpenAPI REST specification without parameter | ||
* substitution, such as <b>/v1/{prefix}/namespaces/{namespace}</b>. | ||
*/ | ||
public class Endpoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: this could probably be an enum
+ a (derived) Map<String, enum>
for loasing server config responses. The spec defines a fixed representation for every value, so parsing is not really necessary, I think, the spec'd values can be keys in that map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good point and I'll probably change that once we agree on the final JSON representation for a single endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good either way here, the parsing is relatively trivial and doesn't seem brittle for equality comparisons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think currently I'm preferring the non-enum approach (basically what's in the PR right now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then how about not parsing the endpoint IDs? I think the spec makes them unambiguous "in whole". Avoiding parsing and component-wise comparisons, would make the processing of those IDs more robust, IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dimas-b we do perform equality checks to make sure that an endpoint is compared as a "whole". A valid endpoint must be of the form GET /resource/path
, which is separated by a single space and the http method must be uppercase + a valid HTTP method, so I'm not sure what the concern here is. Also worth mentioning that all of this is verified in TestEndpoint
e261fa8
to
b2ccbad
Compare
b2ccbad
to
fa22399
Compare
0ce70fe
to
e7817eb
Compare
core/src/main/java/org/apache/iceberg/rest/RESTTableOperations.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/rest/responses/ConfigResponse.java
Outdated
Show resolved
Hide resolved
* resource path as defined in the Iceberg OpenAPI REST specification without parameter | ||
* substitution, such as <b>/v1/{prefix}/namespaces/{namespace}</b>. | ||
*/ | ||
public class Endpoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good either way here, the parsing is relatively trivial and doesn't seem brittle for equality comparisons.
e7817eb
to
564259e
Compare
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
Outdated
Show resolved
Hide resolved
… in ConfigResponse
3524e65
to
9ddd6d3
Compare
9ddd6d3
to
4678b65
Compare
I'll go ahead and merge this, thanks everyone for the feedback/reviews |
Hi, may I know which version of Iceberg will contains this commit? I’m working on a feature in Apache Polaris to support endpoints in /v1/config. Understanding the release timeline for this feature would help us better planning our Iceberg dependency upgrade :) |
@danielhumanmod this will be shipped with Iceberg 1.7.0 |
… in ConfigResponse (apache#10929)
No description provided.