FANNG1 commented on code in PR #8857:
URL: https://github.com/apache/gravitino/pull/8857#discussion_r2447075623
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableOperationExecutor.java:
##########
@@ -41,6 +50,34 @@ public
IcebergTableOperationExecutor(IcebergCatalogWrapperManager icebergCatalog
@Override
public LoadTableResponse createTable(
IcebergRequestContext context, Namespace namespace, CreateTableRequest
createTableRequest) {
+ String authenticatedUser = context.userName();
+ if (StringUtils.isNotBlank(authenticatedUser)
+ && !AuthConstants.ANONYMOUS_USER.equals(authenticatedUser)) {
+ String existingOwner =
createTableRequest.properties().get(OWNER_PROPERTY);
+
+ // Updated the owner as the authenticated user, if owner missing or
different from
+ // authenticated user
+ if (existingOwner == null || !existingOwner.equals(authenticatedUser)) {
Review Comment:
How about using `if(!authenticatedUser.equals(existingOwner)) {}` to simple
the code?
--
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]