haizhou-zhao commented on code in PR #6045: URL: https://github.com/apache/iceberg/pull/6045#discussion_r1004833814
########## hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java: ########## @@ -532,13 +536,27 @@ Database convertToDatabase(Namespace namespace, Map<String, String> meta) { database.setName(namespace.level(0)); database.setLocationUri(databaseLocation(namespace.level(0))); + // default ownership is determined from Hadoop.UGI.currentUser + // and the owner type is default to individual user + try { + // getShortUserName will remove the realm part of the whole username + database.setOwnerName(UserGroupInformation.getCurrentUser().getShortUserName()); Review Comment: "we should do this only if there is no HMS_DB_OWNER set in 'meta'" Make sense, yet I'd encourage uniformity between database ownership and table ownership. If you look at how table ownership is handled right now, there is a default owner (`System.getProperty("user.name")`) if no owner is set: [ref](https://github.com/apache/iceberg/blob/master/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java#L429). I see there's another places where you comment about UGI, so I'm making comments on using UGI there. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org