roryqi commented on code in PR #10586:
URL: https://github.com/apache/gravitino/pull/10586#discussion_r3043093492
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/CatalogWrapperForREST.java:
##########
@@ -535,4 +617,111 @@ private static void replaceDeprecatedProperties(
properties.put(newProperty, deprecatedValue);
}
}
+
+ private LoadTableResponse createTableInternal(Namespace namespace,
CreateTableRequest request) {
+
+ request.validate();
+
+ if (request.stageCreate()) {
+ return stageTableCreateInternal(namespace, request);
+ }
+
+ TableIdentifier ident = TableIdentifier.of(namespace, request.name());
+ Table table =
+ catalog
+ .buildTable(ident, request.schema())
+ .withLocation(request.location())
+ .withPartitionSpec(request.spec())
+ .withSortOrder(request.writeOrder())
+ .withProperties(request.properties())
+ .create();
+
+ if (table instanceof BaseTable) {
+ Map<String, String> properties = retrieveFileIOProperties(table.io());
+ return LoadTableResponse.builder()
+ .withTableMetadata(((BaseTable) table).operations().current())
+ .addAllConfig(
+ MapUtils.getFilteredMap(
+ properties, key ->
catalogPropertiesToClientKeys.contains(key)))
+ // Keep only credential fields from FileIO properties before
returning them to the client.
+
.addAllConfig(CredentialPropertyUtils.filterCredentialProperties(properties))
+ .build();
+ }
+
+ throw new IllegalStateException("Cannot wrap catalog that does not produce
BaseTable");
+ }
+
+ private LoadTableResponse stageTableCreateInternal(
+ Namespace namespace, CreateTableRequest request) {
+ if (!(catalog instanceof RESTCatalog)) {
Review Comment:
Removed.
--
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]