-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Nessie: Infer default API version from URI #9459
Conversation
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.
LGTM 👍 Thanks, @ajantha-bhat !
nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
Outdated
Show resolved
Hide resolved
throw new IllegalArgumentException( | ||
String.format( | ||
"URI doesn't end with the version: %s. " | ||
+ "Please configure `client-api-version` in the catalog properties explicitly.", |
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 wonder whether we can just assume v2
in this case... but I'm fine with throwing an exception too.
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.
If the uri is not ending versions, then it can be a custom implementation which can be based on v1 or v2. So, I didn't want to assume the version there.
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 it would be good to add some tests around this (especially with an invalid URI). Additionally, it would be good to configure both the client-api-version and a URI with v1/v2 to make sure the right setting takes precedence
temp.toUri().toString(), | ||
"client-api-version", | ||
apiVersion == NessieApiVersion.V2 ? "2" : "1"); | ||
temp.toUri().toString()); |
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.
Infers API version using URI.
done. |
Currently default version is v1.
So, If users need V2, they need to configure v2 URI and set the
client-api-version
to "2".With this change, just configuring v2 URI is enough and default version will be inferred from URI.
client-api-version
can still be used for some special cases where custom URI doesn't end with version number.