kevinjqliu opened a new pull request, #16247:
URL: https://github.com/apache/iceberg/pull/16247

   This is the server-side counterpart to #16059 (client-side 
`NoSuchWarehouseException` handling).
   
   ### Changes
   - Add a `validateWarehouse` hook in `RESTCatalogAdapter`'s CONFIG route, 
called when a `warehouse` query param is present (no-op by default)
   - Override `validateWarehouse` in `RESTServerCatalogAdapter` to check 
against the configured warehouse location, throwing `NoSuchWarehouseException` 
(404) for unknown warehouses
   - Register `NoSuchWarehouseException` → 404 in the error code map
   
   ### Testing
   
   Build and run the REST catalog server locally:
   ```bash
   ./gradlew :iceberg-open-api:shadowJar -x test
   CATALOG_WAREHOUSE=mywarehouse java -jar 
open-api/build/libs/iceberg-open-api-test-fixtures-runtime-1.12.0-SNAPSHOT.jar
   ```
   
   `http://localhost:8181/v1/config` -> 202 
   `http://localhost:8181/v1/config?warehouse=mywarehouse` -> 200, exists from 
`CATALOG_WAREHOUSE`
   `http://localhost:8181/v1/config?warehouse=thisdoesntexist` -> 404
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to