getHivePrincipal(showGrantDesc.getPrincipalDesc()),
getHivePrivilegeObject(showGrantDesc.getHiveObj())
);
List<HiveObjectPrivilege> privList = new ArrayList<HiveObjectPrivilege>();
for(HivePrivilegeInfo privInfo : privInfos){
HivePrincipal principal = privInfo.getPrincipal();
HivePrivilegeObject privObj = privInfo.getObject();
HivePrivilege priv = privInfo.getPrivilege();
PrivilegeGrantInfo grantInfo =
AuthorizationUtils.getThriftPrivilegeGrantInfo(priv, privInfo.getGrantorPrincipal(),
privInfo.isGrantOption(), privInfo.getGrantTime());
//only grantInfo is used
HiveObjectPrivilege thriftObjectPriv = new HiveObjectPrivilege(new HiveObjectRef(
AuthorizationUtils.getThriftHiveObjType(privObj.getType()),privObj.getDbname(),
privObj.getTableViewURI(),null,null), principal.getName(),
AuthorizationUtils.getThriftPrincipalType(principal.getType()), grantInfo);
privList.add(thriftObjectPriv);
}
boolean testMode = conf.getBoolVar(HiveConf.ConfVars.HIVE_IN_TEST);
writeToFile(writeGrantInfo(privList, testMode), showGrantDesc.getResFile());
} catch (IOException e) {