use of org.apache.hadoop.hive.ql.security.authorization.Privilege in project hive by apache.
the class DummyHiveMetastoreAuthorizationProvider method debugPrivPrint.
private String debugPrivPrint(Privilege[] privileges) {
StringBuffer sb = new StringBuffer();
sb.append("Privileges{");
if (privileges != null) {
for (Privilege p : privileges) {
sb.append(p.toString());
}
} else {
sb.append("null");
}
sb.append("}");
return sb.toString();
}
use of org.apache.hadoop.hive.ql.security.authorization.Privilege in project hive by apache.
the class HiveAuthorizationTaskFactoryImpl method analyzePrivilegeListDef.
private List<PrivilegeDesc> analyzePrivilegeListDef(ASTNode node) throws SemanticException {
List<PrivilegeDesc> ret = new ArrayList<PrivilegeDesc>();
for (int i = 0; i < node.getChildCount(); i++) {
ASTNode privilegeDef = (ASTNode) node.getChild(i);
ASTNode privilegeType = (ASTNode) privilegeDef.getChild(0);
Privilege privObj = PrivilegeRegistry.getPrivilege(privilegeType.getType());
if (privObj == null) {
throw new SemanticException("Undefined privilege " + PrivilegeType.getPrivTypeByToken(privilegeType.getType()));
}
List<String> cols = null;
if (privilegeDef.getChildCount() > 1) {
cols = BaseSemanticAnalyzer.getColumnNames((ASTNode) privilegeDef.getChild(1));
}
PrivilegeDesc privilegeDesc = new PrivilegeDesc(privObj, cols);
ret.add(privilegeDesc);
}
return ret;
}
Aggregations