GPUdb C++ API  Version 7.2.2.4
execute_sql.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __EXECUTE_SQL_H__
7 #define __EXECUTE_SQL_H__
8 
9 #include "../GenericRecord.hpp"
10 
11 namespace gpudb
12 {
23  {
28  statement(std::string()),
29  offset(int64_t()),
30  limit(int64_t()),
31  encoding(std::string("binary")),
32  requestSchemaStr(std::string()),
33  data(std::vector<std::vector<uint8_t> >()),
34  options(std::map<std::string, std::string>())
35  {
36  }
37 
405  ExecuteSqlRequest(const std::string& statement_, const int64_t offset_, const int64_t limit_, const std::string& requestSchemaStr_, const std::vector<std::vector<uint8_t> >& data_, const std::map<std::string, std::string>& options_):
406  statement( statement_ ),
407  offset( offset_ ),
408  limit( limit_ ),
409  encoding( "binary" ),
410  requestSchemaStr( requestSchemaStr_ ),
411  data( data_ ),
412  options( options_ )
413  {
414  }
415 
795  ExecuteSqlRequest(const std::string& statement_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::string& requestSchemaStr_, const std::vector<std::vector<uint8_t> >& data_, const std::map<std::string, std::string>& options_):
796  statement( statement_ ),
797  offset( offset_ ),
798  limit( limit_ ),
799  encoding( encoding_ ),
800  requestSchemaStr( requestSchemaStr_ ),
801  data( data_ ),
802  options( options_ )
803  {
804  }
805 
809  std::string statement;
810 
817  int64_t offset;
818 
831  int64_t limit;
832 
844  std::string encoding;
845 
849  std::string requestSchemaStr;
850 
857  std::vector<std::vector<uint8_t> > data;
858 
1089  std::map<std::string, std::string> options;
1090  };
1091 } // end namespace gpudb
1092 
1093 namespace avro
1094 {
1095  template<> struct codec_traits<gpudb::ExecuteSqlRequest>
1096  {
1097  static void encode(Encoder& e, const gpudb::ExecuteSqlRequest& v)
1098  {
1099  ::avro::encode(e, v.statement);
1100  ::avro::encode(e, v.offset);
1101  ::avro::encode(e, v.limit);
1102  ::avro::encode(e, v.encoding);
1103  ::avro::encode(e, v.requestSchemaStr);
1104  ::avro::encode(e, v.data);
1105  ::avro::encode(e, v.options);
1106  }
1107 
1108  static void decode(Decoder& d, gpudb::ExecuteSqlRequest& v)
1109  {
1110  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1111  {
1112  const std::vector<size_t> fo = rd->fieldOrder();
1113 
1114  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1115  {
1116  switch (*it)
1117  {
1118  case 0:
1119  ::avro::decode(d, v.statement);
1120  break;
1121 
1122  case 1:
1123  ::avro::decode(d, v.offset);
1124  break;
1125 
1126  case 2:
1127  ::avro::decode(d, v.limit);
1128  break;
1129 
1130  case 3:
1131  ::avro::decode(d, v.encoding);
1132  break;
1133 
1134  case 4:
1135  ::avro::decode(d, v.requestSchemaStr);
1136  break;
1137 
1138  case 5:
1139  ::avro::decode(d, v.data);
1140  break;
1141 
1142  case 6:
1143  ::avro::decode(d, v.options);
1144  break;
1145 
1146  default:
1147  break;
1148  }
1149  }
1150  }
1151  else
1152  {
1153  ::avro::decode(d, v.statement);
1154  ::avro::decode(d, v.offset);
1155  ::avro::decode(d, v.limit);
1156  ::avro::decode(d, v.encoding);
1157  ::avro::decode(d, v.requestSchemaStr);
1158  ::avro::decode(d, v.data);
1159  ::avro::decode(d, v.options);
1160  }
1161  }
1162  };
1163 } // end namespace avro
1164 
1165 namespace gpudb
1166 {
1173  {
1178  countAffected(int64_t()),
1179  responseSchemaStr(std::string()),
1180  binaryEncodedResponse(std::vector<uint8_t>()),
1181  jsonEncodedResponse(std::string()),
1182  totalNumberOfRecords(int64_t()),
1183  hasMoreRecords(bool()),
1184  pagingTable(std::string()),
1185  info(std::map<std::string, std::string>())
1186  {
1187  }
1188 
1192  int64_t countAffected;
1193 
1198  std::string responseSchemaStr;
1199 
1203  std::vector<uint8_t> binaryEncodedResponse;
1204 
1208  std::string jsonEncodedResponse;
1209 
1214 
1224 
1229  std::string pagingTable;
1230 
1239  std::map<std::string, std::string> info;
1240  };
1241 } // end namespace gpudb
1242 
1243 namespace avro
1244 {
1245  template<> struct codec_traits<gpudb::RawExecuteSqlResponse>
1246  {
1247  static void encode(Encoder& e, const gpudb::RawExecuteSqlResponse& v)
1248  {
1249  ::avro::encode(e, v.countAffected);
1250  ::avro::encode(e, v.responseSchemaStr);
1251  ::avro::encode(e, v.binaryEncodedResponse);
1252  ::avro::encode(e, v.jsonEncodedResponse);
1253  ::avro::encode(e, v.totalNumberOfRecords);
1254  ::avro::encode(e, v.hasMoreRecords);
1255  ::avro::encode(e, v.pagingTable);
1256  ::avro::encode(e, v.info);
1257  }
1258 
1259  static void decode(Decoder& d, gpudb::RawExecuteSqlResponse& v)
1260  {
1261  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1262  {
1263  const std::vector<size_t> fo = rd->fieldOrder();
1264 
1265  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1266  {
1267  switch (*it)
1268  {
1269  case 0:
1270  ::avro::decode(d, v.countAffected);
1271  break;
1272 
1273  case 1:
1274  ::avro::decode(d, v.responseSchemaStr);
1275  break;
1276 
1277  case 2:
1278  ::avro::decode(d, v.binaryEncodedResponse);
1279  break;
1280 
1281  case 3:
1282  ::avro::decode(d, v.jsonEncodedResponse);
1283  break;
1284 
1285  case 4:
1286  ::avro::decode(d, v.totalNumberOfRecords);
1287  break;
1288 
1289  case 5:
1290  ::avro::decode(d, v.hasMoreRecords);
1291  break;
1292 
1293  case 6:
1294  ::avro::decode(d, v.pagingTable);
1295  break;
1296 
1297  case 7:
1298  ::avro::decode(d, v.info);
1299  break;
1300 
1301  default:
1302  break;
1303  }
1304  }
1305  }
1306  else
1307  {
1308  ::avro::decode(d, v.countAffected);
1309  ::avro::decode(d, v.responseSchemaStr);
1310  ::avro::decode(d, v.binaryEncodedResponse);
1311  ::avro::decode(d, v.jsonEncodedResponse);
1312  ::avro::decode(d, v.totalNumberOfRecords);
1313  ::avro::decode(d, v.hasMoreRecords);
1314  ::avro::decode(d, v.pagingTable);
1315  ::avro::decode(d, v.info);
1316  }
1317  }
1318  };
1319 } // end namespace avro
1320 
1321 namespace gpudb
1322 {
1328  {
1333  countAffected(int64_t()),
1334  responseSchemaStr(std::string()),
1335  data(std::vector<gpudb::GenericRecord>()),
1336  totalNumberOfRecords(int64_t()),
1337  hasMoreRecords(bool()),
1338  pagingTable(std::string()),
1339  info(std::map<std::string, std::string>()),
1340  dataTypePtr((gpudb::Type*)NULL)
1341  {
1342  }
1343 
1347  int64_t countAffected;
1348 
1352  std::string responseSchemaStr;
1353 
1357  std::vector<gpudb::GenericRecord> data;
1358 
1363 
1373 
1378  std::string pagingTable;
1379 
1388  std::map<std::string, std::string> info;
1389 
1391  };
1392 } // end namespace gpudb
1393 
1394 #endif // __EXECUTE_SQL_H__
gpudb_type_ptr_t dataTypePtr
Definition: execute_sql.h:1390
ExecuteSqlRequest()
Constructs an ExecuteSqlRequest object with default parameters.
Definition: execute_sql.h:27
ExecuteSqlRequest(const std::string &statement_, const int64_t offset_, const int64_t limit_, const std::string &requestSchemaStr_, const std::vector< std::vector< uint8_t > > &data_, const std::map< std::string, std::string > &options_)
Constructs an ExecuteSqlRequest object with the specified parameters.
Definition: execute_sql.h:405
boost::shared_ptr< Type > gpudb_type_ptr_t
std::map< std::string, std::string > options
Optional parameters.
Definition: execute_sql.h:1089
std::string pagingTable
Name of the table that has the result records of the query.
Definition: execute_sql.h:1229
std::string encoding
Specifies the encoding for returned records; either 'binary' or 'json'.
Definition: execute_sql.h:844
int64_t countAffected
The number of objects/records affected.
Definition: execute_sql.h:1347
std::string statement
SQL statement (query, DML, or DDL) to be executed.
Definition: execute_sql.h:809
std::vector< gpudb::GenericRecord > data
Avro binary encoded response.
Definition: execute_sql.h:1357
std::string requestSchemaStr
Avro schema of data.
Definition: execute_sql.h:849
bool hasMoreRecords
Too many records.
Definition: execute_sql.h:1223
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: execute_sql.h:1213
int64_t countAffected
The number of objects/records affected.
Definition: execute_sql.h:1192
ExecuteSqlResponse()
Constructs an ExecuteSqlResponse object with default parameters.
Definition: execute_sql.h:1332
std::string jsonEncodedResponse
Avro JSON encoded response.
Definition: execute_sql.h:1208
int64_t offset
A positive integer indicating the number of initial results to skip (this can be useful for paging th...
Definition: execute_sql.h:817
std::vector< std::vector< uint8_t > > data
An array of binary-encoded data for the records to be binded to the SQL query.
Definition: execute_sql.h:857
A set of results returned by GPUdb::executeSql.
Definition: execute_sql.h:1327
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: execute_sql.h:1362
A set of results returned by GPUdb::executeSqlRaw.
Definition: execute_sql.h:1172
std::string responseSchemaStr
Avro schema of binaryEncodedResponse or jsonEncodedResponse.
Definition: execute_sql.h:1198
bool hasMoreRecords
Too many records.
Definition: execute_sql.h:1372
A set of parameters for GPUdb::executeSql.
Definition: execute_sql.h:22
std::map< std::string, std::string > info
Additional information.
Definition: execute_sql.h:1388
int64_t limit
A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to ...
Definition: execute_sql.h:831
ExecuteSqlRequest(const std::string &statement_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::string &requestSchemaStr_, const std::vector< std::vector< uint8_t > > &data_, const std::map< std::string, std::string > &options_)
Constructs an ExecuteSqlRequest object with the specified parameters.
Definition: execute_sql.h:795
std::map< std::string, std::string > info
Additional information.
Definition: execute_sql.h:1239
std::string pagingTable
Name of the table that has the result records of the query.
Definition: execute_sql.h:1378
RawExecuteSqlResponse()
Constructs a RawExecuteSqlResponse object with default parameters.
Definition: execute_sql.h:1177
std::string responseSchemaStr
Avro schema of data or jsonEncodedResponse.
Definition: execute_sql.h:1352
std::vector< uint8_t > binaryEncodedResponse
Avro binary encoded response.
Definition: execute_sql.h:1203