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.SqlCall;
8 import org.apache.calcite.sql.SqlDdl;
9 import org.apache.calcite.sql.SqlKind;
10 import org.apache.calcite.sql.SqlNode;
11 import org.apache.calcite.sql.SqlNodeList;
13 import org.apache.calcite.sql.SqlSpecialOperator;
14 import org.apache.calcite.sql.parser.SqlParserPos;
16 import org.apache.calcite.util.JsonBuilder;
18 import java.util.List;
23 new SqlSpecialOperator(
"REVOKE_PRIVILEGE", SqlKind.OTHER_DDL);
40 requireNonNull(privileges);
55 Map<String, Object> map = jsonBuilder.map();
58 List<Object> privilege_list = jsonBuilder.list();
60 privilege_list.add(privilege.toString());
62 map.put(
"privileges", privilege_list);
66 map.put(
"target", this.target);
69 List<Object> grantee_list = jsonBuilder.list();
70 for (SqlNode grantee : this.
grantees) {
71 grantee_list.add(grantee.toString());
73 map.put(
"grantees", grantee_list);
76 map.put(
"command",
"REVOKE_PRIVILEGE");
77 Map<String, Object> payload = jsonBuilder.map();
78 payload.put(
"payload", map);
79 return jsonBuilder.toJsonString(payload);
static final SqlOperator OPERATOR
List< SqlNode > getOperandList()
SqlRevokePrivilege(SqlParserPos pos, SqlNodeList privileges, String type, String target, SqlNodeList grantees)