laserninja commented on code in PR #10652:
URL: https://github.com/apache/gravitino/pull/10652#discussion_r3025863191
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergConfigOperations.java:
##########
@@ -98,13 +99,19 @@ public IcebergConfigOperations(IcebergCatalogWrapperManager
catalogWrapperManage
@Produces(MediaType.APPLICATION_JSON)
@Timed(name = "config." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
@ResponseMetered(name = "config", absolute = true)
- public Response getConfig(@DefaultValue("") @QueryParam("warehouse") String
warehouse) {
- String catalogName = getCatalogName(warehouse);
+ public Response getConfig(
+ @PathParam("prefix") String prefix,
+ @DefaultValue("") @QueryParam("warehouse") String warehouse) {
+ String prefixCatalogName = IcebergRESTUtils.getCatalogName(prefix);
+ String catalogName =
+ StringUtils.isNotBlank(prefix) ? prefixCatalogName :
getCatalogName(warehouse);
Review Comment:
Good question. In the current implementation, when both prefix and warehouse
are specified, the prefix takes precedence for catalog resolution (since it's
the path-level identifier), while the warehouse value is used for the "prefix"
key in the response defaults.
However, I see you've raised this same question on the 'Iceberg mailing
list'. If the community consensus is different (e.g., warehouse should take
precedence, or it should be an error to specify both), I'm happy to update the
behavior accordingly. What's your preference here?
Thanks for the pointer, I've read through the thread. The discussion aligns
with what this PR does: the prefix represents the catalog name and a 404 is
returned when the specified catalog doesn't exist. I'll keep an eye on the spec
PR and adjust if the finalized spec diverges from this behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]