plusplusjiajia opened a new pull request, #10816:
URL: https://github.com/apache/paimon/pull/10816

   ### Purpose
   
   As in Java `RESTCatalog`, map the column and database errors from the REST 
server to catalog exceptions:
   
   - `alter_table` reported a missing column as `TableNotExistException`, and a 
column that already exists as the raw `AlreadyExistsException`. A 404 or 409 
with the `COLUMN` resource type now raises `ColumnNotExistException` or 
`ColumnAlreadyExistException`.
   - `create_table` in a missing database raised the raw 
`NoSuchResourceException`. It now raises `DatabaseNotExistException`, as 
`create_function` already does.
   
   Other errors are unchanged: a 404 of another resource type still raises 
`TableNotExistException`, and 400, 500 and 501 still raise the REST exceptions.
   
   The mock REST server now returns 404 and 409 with the `COLUMN` resource type 
for column errors, as the Java `RESTCatalogServer` does, instead of 500.
   
   ### Tests
   
   - `RESTCatalogTest#test_alter_table_column_errors`: dropping a missing 
column, adding an existing column, and altering a missing table with and 
without `ignore_if_not_exists`.
   - `RESTCatalogTest#test_create_table_in_missing_database`.
   - Both fail on master. The REST, API, schema evolution and filesystem 
catalog tests pass locally: 647 tests. flake8 is clean.
   


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