yuqi1129 opened a new issue, #14050:
URL: https://github.com/apache/gravitino/issues/14050

   ### Version
   
   main branch (`60cd039154c329999039b97f337a6baef3963527`)
   
   ### Describe what's wrong
   
   Dropping a schema that contains tables with `cascade=false` should throw 
`NonEmptySchemaException`, which the schema REST handler maps to HTTP 409.
   
   The shared JDBC implementation (inherited by MySQL and OceanBase), Doris and 
StarRocks instead throw `IllegalStateException`, producing HTTP 500. ClickHouse 
throws `IllegalArgumentException`, producing HTTP 400.
   
   ### Error message and/or stacktrace
   
   The JDBC drop-entry regression tests reproduce these exception mismatches:
   
   - JDBC common, Doris, StarRocks: expected `NonEmptySchemaException`, actual 
`IllegalStateException`.
   - ClickHouse: expected `NonEmptySchemaException`, actual 
`IllegalArgumentException`.
   
   The messages already identify a non-empty database, for example: `Database 
nonempty_schema is not empty, the value of cascade should be true.`
   
   ### How to reproduce
   
   1. Create a schema containing a table in one of the affected catalogs.
   2. Call `catalog.asSchemas().dropSchema(schemaName, false)` or send `DELETE 
/api/metalakes/{metalake}/catalogs/{catalog}/schemas/{schema}?cascade=false`.
   3. Observe the exception/response above rather than 
`NonEmptySchemaException`/409.
   
   ### Additional context
   
   The behavior was reproduced locally with JDBC boundary mocks driving the 
actual `delete` entry points. Live database integration tests were not run. 
Empty-schema deletion and supported cascade deletion should retain their 
existing 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]

Reply via email to