bharos commented on code in PR #7444:
URL: https://github.com/apache/gravitino/pull/7444#discussion_r2165947381
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergConfigOperations.java:
##########
@@ -40,13 +45,30 @@ public class IcebergConfigOperations {
@SuppressWarnings("UnusedVariable")
@Context
private HttpServletRequest httpRequest;
+ private final IcebergCatalogWrapperManager catalogWrapperManager;
+
+ @Inject
+ public IcebergConfigOperations(IcebergCatalogWrapperManager
catalogWrapperManager) {
+ this.catalogWrapperManager = catalogWrapperManager;
+ }
@GET
@Produces(MediaType.APPLICATION_JSON)
@Timed(name = "config." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
@ResponseMetered(name = "config", absolute = true)
- public Response getConfig() {
- ConfigResponse response = ConfigResponse.builder().build();
+ public Response getConfig(@DefaultValue("") @QueryParam("warehouse") String
warehouse) {
+ if (warehouse == null || warehouse.isEmpty()) {
+ ConfigResponse response = ConfigResponse.builder().build();
+ return IcebergRestUtils.ok(response);
+ }
+
+ // Get the catalog wrapper which contains the configuration
+ CatalogWrapperForREST catalogWrapper =
catalogWrapperManager.getCatalogWrapper(warehouse);
Review Comment:
When I set the `warehouse` to non-existent value, like
```
spark.sql.catalog.spark_catalog.warehouse=invalid
```
client says
```
Spark master: local[*], Application Id: local-1750834613853
Exception in thread "main"
org.apache.iceberg.exceptions.ServiceFailureException: Server error:
RuntimeException: Couldn't find Iceberg configuration for invalid
```
--
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]