haizhou-zhao commented on code in PR #6045:
URL: https://github.com/apache/iceberg/pull/6045#discussion_r1004956670


##########
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());
+      database.setOwnerType(PrincipalType.USER);
+    } catch (IOException e) {
+      LOG.error("Unable to determine the current UGI user", e);
+      throw new RuntimeException(e);

Review Comment:
   I'm good with not setting these fields. Additionally, I think we should keep 
the behavior the same between database and table.



-- 
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

Reply via email to