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(
"GRANT_PRIVILEGE", SqlKind.OTHER_DDL);
37 requireNonNull(privileges);
52 Map<String, Object> map = jsonBuilder.map();
55 List<Object> privilege_list = jsonBuilder.list();
59 privilege_list.add(privilege.toString());
61 map.put(
"privileges", privilege_list);
65 map.put(
"target", this.target);
68 List<Object> grantee_list = jsonBuilder.list();
69 for (SqlNode grantee : this.
grantees) {
70 grantee_list.add(grantee.toString());
72 map.put(
"grantees", grantee_list);
75 map.put(
"command",
"GRANT_PRIVILEGE");
76 Map<String, Object> payload = jsonBuilder.map();
77 payload.put(
"payload", map);
78 return jsonBuilder.toJsonString(payload);
List< SqlNode > getOperandList()
SqlGrantPrivilege(SqlParserPos pos, SqlNodeList privileges, String type, String target, SqlNodeList grantees)
static final SqlOperator OPERATOR