presto-hive/src/main/java/io/prestosql/plugin/hive/authentication/UserGroupInformationUtils.java/UserGroupInformationUtils/executeActionInDoAs
class UserGroupInformationUtils:    static <R, E extends Exception> R executeActionInDoAs(UserGroupInformation userGroupInformation, GenericExceptionAction<R, E> action)
            throws E
    {
        return userGroupInformation.doAs((PrivilegedAction<ResultOrException<R, E>>) () -> {
            try {
                return new ResultOrException<>(action.run(), null);
            }
            catch (Throwable e) {
                return new ResultOrException<>(null, e);
            }
        }).get();
    }