OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SqlDropRole.java
Go to the documentation of this file.
1 
2 
3 package com.mapd.parser.extension.ddl;
4 
5 import static java.util.Objects.requireNonNull;
6 
7 import com.google.gson.annotations.Expose;
8 
9 import org.apache.calcite.sql.SqlDrop;
10 import org.apache.calcite.sql.SqlIdentifier;
11 import org.apache.calcite.sql.SqlKind;
12 import org.apache.calcite.sql.SqlNode;
13 import org.apache.calcite.sql.SqlOperator;
14 import org.apache.calcite.sql.SqlSpecialOperator;
15 import org.apache.calcite.sql.parser.Span;
16 import org.apache.calcite.sql.parser.SqlParserPos;
18 
19 import java.util.List;
20 import java.util.Map;
21 import java.util.Objects;
22 
26 public class SqlDropRole extends SqlDrop implements JsonSerializableDdl {
27  private static final SqlOperator OPERATOR =
28  new SqlSpecialOperator("DROP_ROLE", SqlKind.OTHER_DDL);
29 
30  @Expose
31  private String role;
32  @Expose
33  private String command;
34 
35  public SqlDropRole(SqlParserPos pos, String role) {
36  super(OPERATOR, pos, false);
37  this.role = role;
38  this.command = OPERATOR.getName();
39  }
40 
41  @Override
42  public List<SqlNode> getOperandList() {
43  return null;
44  }
45 
46  @Override
47  public String toString() {
49  Map<String, Object> map = jsonBuilder.map();
50  jsonBuilder.put(map, "role", this.role.toString());
51  map.put("command", "DROP_ROLE");
52  Map<String, Object> payload = jsonBuilder.map();
53  payload.put("payload", map);
54  return jsonBuilder.toJsonString(payload);
55  }
56 }
SqlDropRole(SqlParserPos pos, String role)