zhouyifan279 commented on code in PR #6955: URL: https://github.com/apache/iceberg/pull/6955#discussion_r1124452626
########## hive-metastore/src/main/java/org/apache/iceberg/hive/HiveHadoopUtil.java: ########## @@ -30,11 +30,12 @@ public class HiveHadoopUtil { private HiveHadoopUtil() {} public static String currentUser() { + String username = null; try { - return UserGroupInformation.getCurrentUser().getUserName(); + username = UserGroupInformation.getCurrentUser().getShortUserName(); } catch (IOException e) { LOG.warn("Failed to get Hadoop user", e); - return System.getProperty("user.name"); } + return username != null ? username : System.getProperty("user.name"); Review Comment: > Not sure why we need to change this, i think this makes it harder to read, with another conditional operator UserGroupInformation#getShortUserName() may return null before hadoop 2.8.2. But it rarely happens in practice. Let me restore the original code struct. -- 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