szehon-ho commented on code in PR #6324:
URL: https://github.com/apache/iceberg/pull/6324#discussion_r1038443524


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -567,8 +569,13 @@ Database convertToDatabase(Namespace namespace, 
Map<String, String> meta) {
         });
 
     if (database.getOwnerName() == null) {
-      database.setOwnerName(System.getProperty("user.name"));
-      database.setOwnerType(PrincipalType.USER);
+      try {
+        
database.setOwnerName(UserGroupInformation.getCurrentUser().getUserName());
+        database.setOwnerType(PrincipalType.USER);
+      } catch (IOException e) {
+        throw new RuntimeException(

Review Comment:
   I think this was also discussed in 
https://github.com/apache/iceberg/pull/6045#discussion_r1004158438.  Should we 
just warn and fallback?  @gaborkaszab @danielcweeks 
   
   by the way, if we throw we have our own UnchekcedIOException



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -470,6 +481,22 @@ private void setHmsTableParameters(
     // remove any props from HMS that are no longer present in Iceberg table 
props
     obsoleteProps.forEach(parameters::remove);
 
+    if (metadata.property(HiveCatalog.HMS_TABLE_OWNER, null) != null) {

Review Comment:
   Looks like this code is for the update case and is going a bit beyond 
original behavior (which was for create case).  
   
   cc @gaborkaszab for thoughts
   
   And does it align with database/namespace update?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to