OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SqlAlterForeignTable.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl;
2 
3 import com.google.gson.annotations.Expose;
4 
5 import org.apache.calcite.sql.SqlDdl;
6 import org.apache.calcite.sql.SqlKind;
7 import org.apache.calcite.sql.SqlNode;
8 import org.apache.calcite.sql.SqlOperator;
9 import org.apache.calcite.sql.SqlSpecialOperator;
10 import org.apache.calcite.sql.parser.SqlParserPos;
11 
12 import java.util.List;
13 import java.util.Map;
14 
19 public class SqlAlterForeignTable extends SqlDdl implements JsonSerializableDdl {
20  private static final SqlOperator OPERATOR =
21  new SqlSpecialOperator("ALTER_FOREIGN_TABLE", SqlKind.OTHER_DDL);
22 
28  public static class Builder extends SqlOptionsBuilder {
29  private SqlParserPos pos;
30  private String tableName;
31 
32  public void setPos(final SqlParserPos pos) {
33  this.pos = pos;
34  }
35 
36  public void setTableName(final String tableName) {
37  this.tableName = tableName;
38  }
39 
40  public void setOptions(final Map<String, String> options) {
41  this.options = options;
42  }
43 
45  return new SqlAlterForeignTable(pos, tableName, super.options);
46  }
47  }
48 
49  @Expose
50  private String tableName;
51  @Expose
52  private String command;
53  @Expose
54  private Map<String, String> options;
55 
56  public SqlAlterForeignTable(final SqlParserPos pos,
57  final String tableName,
58  final Map<String, String> options) {
59  super(OPERATOR, pos);
60  this.tableName = tableName;
61  this.options = options;
62  this.command = OPERATOR.getName();
63  }
64 
65  @Override
66  public List<SqlNode> getOperandList() {
67  return null;
68  }
69 
70  @Override
71  public String toString() {
72  return toJsonString();
73  }
74 }
SqlAlterForeignTable(final SqlParserPos pos, final String tableName, final Map< String, String > options)