Return 404 when semantic models disappear during deletion - #5499
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified that would block approval.
Pull request overview
Updates semantic model deletion to return HTTP 404 when the model or catalog path disappears during deletion.
Changes:
- Maps relevant persistence statuses to
NoSuchSemanticModelException. - Adds parameterized coverage for both missing-resource statuses.
- Documents the behavior in the changelog.
File summaries
| File | Description |
|---|---|
| extensions/semantic-models/src/test/java/org/apache/polaris/service/catalog/semanticmodel/SemanticModelCatalogTest.java | Updated as part of this pull request. |
| extensions/semantic-models/src/main/java/org/apache/polaris/service/catalog/semanticmodel/SemanticModelCatalog.java | Updated as part of this pull request. |
| CHANGELOG.md | Updated as part of this pull request. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
flyrain
commented
Sep 11, 2026
| "Failed to drop semantic model %s error status: %s with extraInfo: %s", | ||
| identifier, result.getReturnStatus(), result.getExtraInformation())); | ||
| switch (result.getReturnStatus()) { | ||
| case ENTITY_NOT_FOUND, CATALOG_PATH_CANNOT_BE_RESOLVED -> |
Contributor
Author
There was a problem hiding this comment.
This is consistent with table/view drop behavior.
6 tasks done
dimas-b
previously approved these changes
Sep 11, 2026
6 tasks done
dimas-b
approved these changes
Sep 11, 2026
flyingImer
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting a semantic model currently returns HTTP 500 if the model or its catalog path disappears after resolution and before the deletion is persisted. Return
NoSuchSemanticModelException(HTTP 404) forENTITY_NOT_FOUNDandCATALOG_PATH_CANNOT_BE_RESOLVED, consistent with deleting a model that is already missing at lookup time. Other persistence failures retain their existing handling.Related to #4522
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed): no additional guide changes; the API specification already documents HTTP 404 for a missing model.