lasdf1234 opened a new pull request, #11168:
URL: https://github.com/apache/gravitino/pull/11168

   ## Summary
   
   - Map `NamespaceNotEmptyException` to HTTP **409 Conflict** in 
`IcebergExceptionMapper`, matching the Iceberg REST spec and upstream 
`RESTCatalogAdapter`.
   - Stop converting `NamespaceNotEmptyException` to `BadRequestException` in 
`convertToIcebergException`.
   - Update unit tests and add REST coverage for dropping a non-empty namespace.
   
   ## Why are the changes needed?
   
   `dropNamespace` on a non-empty namespace must return 409 per the Iceberg 
REST API. Gravitino currently returns 400, which is non-conformant and can 
confuse REST clients.
   
   Fixes [#11132](https://github.com/apache/gravitino/issues/11132). Part of 
[#11131](https://github.com/apache/gravitino/issues/11131).
   
   ## Does this PR introduce any user-facing change?
   
   Yes. Clients calling `DELETE` namespace when the namespace is not empty will 
receive **409 Conflict** instead of **400 Bad Request**. The error type remains 
`NamespaceNotEmptyException`.
   
   ## Test plan
   
   - [x] `./gradlew :iceberg:iceberg-rest-server:test --tests 
"org.apache.gravitino.iceberg.service.TestIcebergExceptionMapper" -PskipITs`
   - [x] `./gradlew :iceberg:iceberg-rest-server:test --tests 
"org.apache.gravitino.iceberg.service.rest.TestIcebergNamespaceOperations#testDropNamespace"
 -PskipITs`
   - [x] `./gradlew :iceberg:iceberg-rest-server:test --tests 
"org.apache.gravitino.iceberg.integration.test.IcebergRESTMemoryCatalogIT#testDropNameSpace"
 -PskipITs`
   
   
   Made with [Cursor](https://cursor.com)


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

Reply via email to