kbendick commented on code in PR #4448:
URL: https://github.com/apache/iceberg/pull/4448#discussion_r865420341
##########
core/src/main/java/org/apache/iceberg/rest/RESTCatalog.java:
##########
@@ -113,7 +114,14 @@ public boolean dropTable(TableIdentifier identifier,
boolean purge) {
@Override
public void renameTable(TableIdentifier from, TableIdentifier to) {
+ RenameTableRequest request = RenameTableRequest.builder()
+ .withSource(from)
+ .withDestination(to)
+ .build();
+ // for now, ignore the response because there is no way to return it.
+ // also, the spec does not define a response beyond simply `ok`.
+ client.post("v1/tables/rename", request, null,
ErrorHandlers.tableErrorHandler());
Review Comment:
Looking at the spec, I think that 204 might not be the best, as that
indicates that the page should not be refreshed.
If a web UI were to receive a 204 response, it would possibly not refresh
the page, but if the rename is successful and the page lists the current
tables, then the UI should refresh.
https://www.rfc-editor.org/rfc/rfc2616#section-10.2.5
```
[10.2.5](https://www.rfc-editor.org/rfc/rfc2616#section-10.2.5) 204 No
Content
The server has fulfilled the request but does not need to return an
entity-body, and might want to return updated metainformation. The
response MAY include new or updated metainformation in the form of
entity-headers, which if present SHOULD be associated with the
requested variant.
If the client is a user agent, it SHOULD NOT change its document view
from that which caused the request to be sent. This response is
primarily intended to allow input for actions to take place without
causing a change to the user agent's active document view, although
any new or updated metainformation SHOULD be applied to the document
currently in the user agent's active view.
The 204 response MUST NOT include a message-body, and thus is always
terminated by the first empty line after the header fields.
```
That said, given that there's no response body, I am open either way.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]