use of org.apache.hadoop.hive.metastore.model.MPartitionPrivilege in project hive by apache.
the class ObjectStore method getPartitionPrivilege.
private List<PrivilegeGrantInfo> getPartitionPrivilege(String dbName, String tableName, String partName, String principalName, PrincipalType principalType) {
tableName = HiveStringUtils.normalizeIdentifier(tableName);
dbName = HiveStringUtils.normalizeIdentifier(dbName);
if (principalName != null) {
List<MPartitionPrivilege> userNameTabPartPriv = this.listPrincipalMPartitionGrants(principalName, principalType, dbName, tableName, partName);
if (userNameTabPartPriv != null && userNameTabPartPriv.size() > 0) {
List<PrivilegeGrantInfo> grantInfos = new ArrayList<PrivilegeGrantInfo>(userNameTabPartPriv.size());
for (int i = 0; i < userNameTabPartPriv.size(); i++) {
MPartitionPrivilege item = userNameTabPartPriv.get(i);
grantInfos.add(new PrivilegeGrantInfo(item.getPrivilege(), item.getCreateTime(), item.getGrantor(), getPrincipalTypeFromStr(item.getGrantorType()), item.getGrantOption()));
}
return grantInfos;
}
}
return new ArrayList<PrivilegeGrantInfo>(0);
}
Aggregations