roryqi commented on code in PR #13551:
URL: https://github.com/apache/gravitino/pull/13551#discussion_r4121872055
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableOperationExecutor.java:
##########
@@ -115,6 +118,7 @@ public LoadTableResponse updateTable(
IcebergRequestContext context,
TableIdentifier tableIdentifier,
UpdateTableRequest updateTableRequest) {
+ IcebergColumnFieldValidator.validateUpdate(updateTableRequest);
Review Comment:
Fixed in commit 7c3d4dd120. updateTable now detects AssertTableDoesNotExist
and validates tableIdentifier.name() before invoking the catalog wrapper. The
regression test uses an oversized identifier and verifies that the wrapper has
no interactions.
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergNamespaceOperationExecutor.java:
##########
@@ -128,12 +130,16 @@ public LoadTableResponse registerTable(
IcebergRequestContext context,
Namespace namespace,
RegisterTableRequest registerTableRequest) {
+ TableEntity.NAME.validate(registerTableRequest.name(),
Entity.EntityType.TABLE);
IcebergCleanupHelper.rejectIfBeingPurged(
cleanupManager, context.catalogName(), namespace,
registerTableRequest.name());
- return icebergCatalogWrapperManager
- .getCatalogWrapper(context.catalogName())
- .registerTable(namespace, registerTableRequest,
context.requestCredentialVending());
+ LoadTableResponse response =
+ icebergCatalogWrapperManager
+ .getCatalogWrapper(context.catalogName())
+ .registerTable(namespace, registerTableRequest,
context.requestCredentialVending());
+
IcebergColumnFieldValidator.validateSchema(response.tableMetadata().schema());
Review Comment:
Fixed in commit 7c3d4dd120. registerTable now loads metadata from the
requested metadata location and validates its schema before register/overwrite.
The unit tests verify that invalid metadata never reaches registerTable, and a
SQLite catalog regression test confirms that an invalid overwrite leaves the
existing metadata pointer unchanged.
--
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]