Skip to content

[core] Rethrow foreign typed 404s from alterTable - #10268

Open
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-087-rest-alter
Open

LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-087-rest-alter

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Purpose

RESTCatalog.alterTable handles a NoSuchResourceException by mapping the TABLE and COLUMN resource types to the right behavior, but with ignoreIfNotExists = false any other resource type falls through the if/else-if chain and the method returns normally, reporting success on an alter that did not apply. This happens when the server returns a non-table/column 404, for example a DATABASE not-found because the table's database was concurrently dropped.

This rethrows the exception for the unmapped resource types, so the failure reaches the caller. The sibling createBranch already rethrows in the analogous default branch of the same dispatch. The ignoreIfNotExists = true path is unchanged and still swallows every 404.

This closes #10267.

Tests

  • MockRESTCatalogTest gains a case that injects a non-table/column 404 into alterTable with ignoreIfNotExists = false and asserts the exception propagates. Without the fix the method returned normally, so the assertion failed.

API and Format

No.

Documentation

No.

The alterTable catch for NoSuchResourceException translated TABLE
and COLUMN typed 404s but silently returned for any other resource
type, for example a DATABASE typed 404 when the database was dropped
concurrently, so a failed ALTER reported success.

Rethrow unhandled resource types like the sibling methods do.

Assisted-by: GLM-5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST Catalog alterTable silently reports success when the server returns a non-table/column 404

1 participant