OmniSciDB  b28c0d5765
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.parser.extension.ddl.SqlRenameTable Class Reference
+ Inheritance diagram for com.mapd.parser.extension.ddl.SqlRenameTable:
+ Collaboration diagram for com.mapd.parser.extension.ddl.SqlRenameTable:

Public Member Functions

 SqlRenameTable (final SqlParserPos pos, final List< Pair< String, String >> tableNamesIn)
 
List< SqlNode > getOperandList ()
 
String toString ()
 

Private Attributes

List< Pair< String, String > > tableNames = new ArrayList<Pair<String, String>>()
 

Static Private Attributes

static final SqlOperator OPERATOR
 

Detailed Description

Class that encapsulates all information associated with a RENAME TABLE DDL command.

Definition at line 22 of file SqlRenameTable.java.

Constructor & Destructor Documentation

com.mapd.parser.extension.ddl.SqlRenameTable.SqlRenameTable ( final SqlParserPos  pos,
final List< Pair< String, String >>  tableNamesIn 
)
inline

Definition at line 29 of file SqlRenameTable.java.

References com.mapd.parser.extension.ddl.SqlRenameTable.OPERATOR.

30  {
31  super(OPERATOR, pos);
32  this.tableNames = tableNamesIn;
33  }

Member Function Documentation

List<SqlNode> com.mapd.parser.extension.ddl.SqlRenameTable.getOperandList ( )
inline

Definition at line 36 of file SqlRenameTable.java.

36  {
37  return null;
38  }
String com.mapd.parser.extension.ddl.SqlRenameTable.toString ( )
inline

Definition at line 41 of file SqlRenameTable.java.

References com.mapd.parser.extension.ddl.SqlRenameTable.tableNames.

41  {
42  JsonBuilder jsonBuilder = new EscapedStringJsonBuilder();
43  Map<String, Object> map = jsonBuilder.map();
44 
45  map.put("command", "RENAME_TABLE");
46 
47  List<Object> elements_list = jsonBuilder.list();
48  for (Pair<String, String> value : this.tableNames) {
49  Map<String, Object> pairMap = jsonBuilder.map();
50  pairMap.put("name", value.left);
51  pairMap.put("newName", value.right);
52  elements_list.add(pairMap);
53  }
54  map.put("tableNames", elements_list);
55 
56  Map<String, Object> payload = jsonBuilder.map();
57  payload.put("payload", map);
58 
59  // to Debug:
60  // System.out.println(jsonBuilder.toJsonString(payload));
61 
62  return jsonBuilder.toJsonString(payload);
63  }
List< Pair< String, String > > tableNames

Member Data Documentation

final SqlOperator com.mapd.parser.extension.ddl.SqlRenameTable.OPERATOR
staticprivate
Initial value:
=
new SqlSpecialOperator("RENAME_TABLE", SqlKind.OTHER_DDL)

Definition at line 23 of file SqlRenameTable.java.

Referenced by com.mapd.parser.extension.ddl.SqlRenameTable.SqlRenameTable().

List<Pair<String, String> > com.mapd.parser.extension.ddl.SqlRenameTable.tableNames = new ArrayList<Pair<String, String>>()
private

The documentation for this class was generated from the following file: