Search in sources :

Example 1 with ShowPrincipalsDesc

use of org.apache.hadoop.hive.ql.ddl.privilege.show.principals.ShowPrincipalsDesc in project hive by apache.

the class HiveAuthorizationTaskFactoryImpl method createShowRolePrincipalsTask.

@Override
public Task<?> createShowRolePrincipalsTask(ASTNode ast, Path resFile, Set<ReadEntity> inputs, Set<WriteEntity> outputs) throws SemanticException {
    String roleName;
    if (ast.getChildCount() == 1) {
        roleName = ast.getChild(0).getText();
    } else {
        // the parser should not allow this
        throw new AssertionError("Unexpected Tokens in SHOW ROLE PRINCIPALS");
    }
    ShowPrincipalsDesc showPrincipalsDesc = new ShowPrincipalsDesc(roleName, resFile.toString());
    return TaskFactory.get(new DDLWork(inputs, outputs, showPrincipalsDesc));
}
Also used : DDLWork(org.apache.hadoop.hive.ql.ddl.DDLWork) ShowPrincipalsDesc(org.apache.hadoop.hive.ql.ddl.privilege.show.principals.ShowPrincipalsDesc)

Aggregations

DDLWork (org.apache.hadoop.hive.ql.ddl.DDLWork)1 ShowPrincipalsDesc (org.apache.hadoop.hive.ql.ddl.privilege.show.principals.ShowPrincipalsDesc)1