OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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>>()
 
String command
 

Static Private Attributes

static final SqlOperator OPERATOR
 

Detailed Description

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

Definition at line 25 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 34 of file SqlRenameTable.java.

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

35  {
36  super(OPERATOR, pos);
37  this.tableNames = tableNamesIn;
38  this.command = OPERATOR.getName();
39  }

Member Function Documentation

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

Definition at line 42 of file SqlRenameTable.java.

42  {
43  return null;
44  }
String com.mapd.parser.extension.ddl.SqlRenameTable.toString ( )
inline

Definition at line 47 of file SqlRenameTable.java.

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

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

Member Data Documentation

String com.mapd.parser.extension.ddl.SqlRenameTable.command
private

Definition at line 32 of file SqlRenameTable.java.

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

Definition at line 26 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: