iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Core: Make CatalogHandlers.commit public

Open N-o-Z opened this issue 1 year ago • 3 comments

Externalize TableMetadata's commit method so that the TableMetadata class can be used in custom REST catalog implementations

N-o-Z avatar Feb 24 '24 15:02 N-o-Z

I believe the purpose was that CatalogHandlers.commit(..) should only be used through CatalogHandlers.updateTable(...). Is there a particular issue that prevents you from going through CatalogHandlers.updateTable(...)?

AFAIU updateTable recieves a single UpdateTableRequest, and is used in the REST context to handle an UPDATE_TABLE request. On the other hand the COMMIT_TRANSACTION request receives a list of UpdateTableRequest and preforms updates on all requests as an atomic operation. I don't see how this can be achieved using updateTable

N-o-Z avatar Feb 26 '24 13:02 N-o-Z

@N-o-Z can you elaborate please what exactly you're trying to achieve? Are you trying to implement multi-table commits on the server? For COMMIT_TRANSACTION the approach is very simplistic and does not guarantee true transactional behavior as indicated in https://github.com/apache/iceberg/blob/9dcf8dbc4285ad4ab4c1975562bf93fb04747cdd/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java#L479-L507.

nastra avatar Feb 26 '24 15:02 nastra

@N-o-Z can you elaborate please what exactly you're trying to achieve? Are you trying to implement multi-table commits on the server? For COMMIT_TRANSACTION the approach is very simplistic and does not guarantee true transactional behavior as indicated in

https://github.com/apache/iceberg/blob/9dcf8dbc4285ad4ab4c1975562bf93fb04747cdd/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java#L479-L507

.

I wanted to use this as an intermediate solution before implementing a more robust transactional functionality. But if you think this is not a good idea, feel free to close this PR

N-o-Z avatar Feb 26 '24 15:02 N-o-Z