15 package com.cloudera.impala.analysis;
19 import com.cloudera.impala.thrift.TGrantRevokePrivParams;
20 import com.cloudera.impala.thrift.TPrivilege;
21 import com.google.common.base.Preconditions;
22 import com.google.common.base.Strings;
23 import com.google.common.collect.Lists;
43 boolean isGrantPrivStmt,
boolean hasGrantOpt) {
44 Preconditions.checkNotNull(privilegeSpec);
45 Preconditions.checkNotNull(roleName);
53 TGrantRevokePrivParams params =
new TGrantRevokePrivParams();
56 TPrivilege privilege = privilegeSpec_.toThrift();
57 privilege.setRole_id(role_.getId());
59 params.setPrivileges(Lists.newArrayList(privilege));
65 StringBuilder sb =
new StringBuilder(
isGrantPrivStmt_ ?
"GRANT " :
"REVOKE ");
67 sb.append(privilegeSpec_.toSql());
76 super.analyze(analyzer);
85 privilegeSpec_.analyze(analyzer);
final PrivilegeSpec privilegeSpec_
TGrantRevokePrivParams toThrift()
void analyze(Analyzer analyzer)
final boolean isGrantPrivStmt_
final boolean hasGrantOpt_
GrantRevokePrivStmt(String roleName, PrivilegeSpec privilegeSpec, boolean isGrantPrivStmt, boolean hasGrantOpt)