use of org.apache.hadoop.hive.ql.ddl.privilege.role.create.CreateRoleDesc in project hive by apache.
the class HiveAuthorizationTaskFactoryImpl method createCreateRoleTask.
@Override
public Task<?> createCreateRoleTask(ASTNode ast, Set<ReadEntity> inputs, Set<WriteEntity> outputs) {
String roleName = BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText());
CreateRoleDesc createRoleDesc = new CreateRoleDesc(roleName);
return TaskFactory.get(new DDLWork(inputs, outputs, createRoleDesc));
}
use of org.apache.hadoop.hive.ql.ddl.privilege.role.create.CreateRoleDesc in project hive by apache.
the class TestHiveAuthorizationTaskFactory method testCreateRole.
/**
* CREATE ROLE ...
*/
@Test
public void testCreateRole() throws Exception {
DDLWork work = analyze("CREATE ROLE " + ROLE);
CreateRoleDesc roleDesc = (CreateRoleDesc) work.getDDLDesc();
Assert.assertNotNull("Role should not be null", roleDesc);
Assert.assertEquals(ROLE, roleDesc.getName());
}
Aggregations