rdblue commented on code in PR #6324: URL: https://github.com/apache/iceberg/pull/6324#discussion_r1051690244
########## hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java: ########## @@ -567,8 +570,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 UncheckedIOException( + String.format("Fail to obtain default (UGI) user for database %s", database), e); Review Comment: I think this should fall back to the previous behavior. This should be a warning, not an exception. Also, I think the message could be more clear: "Failed to fetch Hadoop user". No need to log the database, it's unrelated to what failed. -- 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