1 package com.mapd.parser.extension.ddl;
3 import static java.util.Objects.requireNonNull;
5 import com.google.gson.annotations.Expose;
7 import org.apache.calcite.sql.SqlDdl;
8 import org.apache.calcite.sql.SqlKind;
9 import org.apache.calcite.sql.SqlNode;
10 import org.apache.calcite.sql.SqlNodeList;
12 import org.apache.calcite.sql.SqlSpecialOperator;
13 import org.apache.calcite.sql.parser.SqlParserPos;
16 import java.util.List;
21 new SqlSpecialOperator(
"REVOKE_ROLE", SqlKind.OTHER_DDL);
30 requireNonNull(roles);
43 Map<String, Object> map = jsonBuilder.map();
45 if (this.
roles != null) {
46 List<Object> roles_list = jsonBuilder.list();
47 for (SqlNode role : this.
roles) {
48 roles_list.add(role.toString());
50 map.put(
"roles", roles_list);
54 List<Object> grantee_list = jsonBuilder.list();
55 for (SqlNode grantee : this.
grantees) {
56 grantee_list.add(grantee.toString());
58 map.put(
"grantees", grantee_list);
61 map.put(
"command",
"REVOKE_ROLE");
62 Map<String, Object> payload = jsonBuilder.map();
63 payload.put(
"payload", map);
64 return jsonBuilder.toJsonString(payload);
SqlRevokeRole(SqlParserPos pos, SqlNodeList roles, SqlNodeList grantees)
static final SqlOperator OPERATOR
List< SqlNode > getOperandList()