Skip to content

fix(catalog/rest): Handle 204 No Content response in doPost for renameTable - #633

Merged
zeroshade merged 1 commit into
apache:mainfrom
ankur-anand:rename-fix
Nov 30, 2025
Merged

zeroshade merged 1 commit into
apache:mainfrom
ankur-anand:rename-fix

Conversation

@ankur-anand

Copy link
Copy Markdown
Contributor

Fix doPost function to handle 204 No Content responses, which is the spec-compliant 
response for the POST /v1/{prefix}/tables/rename endpoint.

The Iceberg REST Catalog OpenAPI spec defines renameTable as returning 204 No Content:

/v1/{prefix}/tables/rename:
  post:
    operationId: renameTable
    responses:
      204:
        description: Success, no contentHowever, the current `doPost` implementation only accepts `200 OK`:

Current implementation expected 200 status code:

if rsp.StatusCode != http.StatusOK {
    return ret, handleNon200(rsp, override)
}

This causes RenameTable to fail with an empty error when interacting with 
spec-compliant REST catalog servers, even though the rename operation succeeds.

### Related

- Iceberg REST OpenAPI Spec: https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml
- Similar handling already exists in do() function via allowNoContent parameter

@zeroshade
zeroshade merged commit 6329b25 into apache:main Nov 30, 2025
@ankur-anand
ankur-anand deleted the rename-fix branch December 1, 2025 07:58
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.

2 participants