}
// setup appropriate UGI for the session
public void setSessionUGI(String owner) throws HiveSQLException {
if (owner == null) {
throw new HiveSQLException("No username provided for impersonation");
}
if (ShimLoader.getHadoopShims().isSecurityEnabled()) {
try {
sessionUgi = ShimLoader.getHadoopShims().createProxyUser(owner);
} catch (IOException e) {
throw new HiveSQLException("Couldn't setup proxy user", e);
}
} else {
sessionUgi = ShimLoader.getHadoopShims().createRemoteUser(owner, null);
}
}