diqiu50 commented on code in PR #10989:
URL: https://github.com/apache/gravitino/pull/10989#discussion_r3212355833
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/CatalogWrapperForREST.java:
##########
@@ -735,6 +743,51 @@ private LoadTableResponse stageTableCreateInternal(
return
LoadTableResponse.builder().withTableMetadata(metadata).addAllConfig(config).build();
}
+ private LoadTableResponse tableUpdateInternal(TableIdentifier ident,
UpdateTableRequest request) {
+ if (isCreate(request)) {
+ // this is a hacky way to get TableOperations for an uncommitted table
+ Optional<Integer> formatVersion =
+ request.updates().stream()
+ .filter(update -> update instanceof
MetadataUpdate.UpgradeFormatVersion)
+ .map(update -> ((MetadataUpdate.UpgradeFormatVersion)
update).formatVersion())
+ .findFirst();
+
+ Schema schema =
+ request.updates().stream()
+ .filter(update -> update instanceof MetadataUpdate.AddSchema)
+ .map(update -> ((MetadataUpdate.AddSchema) update).schema())
+ .findFirst()
+ .orElse(EMPTY_SCHEMA);
Review Comment:
Does this case normally exist? Should we throw an exception?
--
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]