szehon-ho commented on code in PR #6955:
URL: https://github.com/apache/iceberg/pull/6955#discussion_r1124935931
##########
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:
@zhouyifan279 Ugh, didn't realize that, yea its ugly but I guess better to
be defensive in that case.
Sorry let's just restore it to your original way then? (if ok with everyone)
--
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]