GPUdb C++ API  Version 7.2.3.0
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 {
42  {
47  statement(std::string()),
48  offset(int64_t()),
49  limit(int64_t()),
50  encoding(std::string("binary")),
51  requestSchemaStr(std::string()),
52  data(std::vector<std::vector<uint8_t> >()),
53  options(std::map<std::string, std::string>())
54  {
55  }
56 
453  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_):
454  statement( statement_ ),
455  offset( offset_ ),
456  limit( limit_ ),
457  encoding( "binary" ),
458  requestSchemaStr( requestSchemaStr_ ),
459  data( data_ ),
460  options( options_ )
461  {
462  }
463 
872  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_):
873  statement( statement_ ),
874  offset( offset_ ),
875  limit( limit_ ),
876  encoding( encoding_ ),
877  requestSchemaStr( requestSchemaStr_ ),
878  data( data_ ),
879  options( options_ )
880  {
881  }
882 
886  std::string statement;
887 
894  int64_t offset;
895 
908  int64_t limit;
909 
921  std::string encoding;
922 
926  std::string requestSchemaStr;
927 
934  std::vector<std::vector<uint8_t> > data;
935 
1183  std::map<std::string, std::string> options;
1184  };
1185 } // end namespace gpudb
1186 
1187 namespace avro
1188 {
1189  template<> struct codec_traits<gpudb::ExecuteSqlRequest>
1190  {
1191  static void encode(Encoder& e, const gpudb::ExecuteSqlRequest& v)
1192  {
1193  ::avro::encode(e, v.statement);
1194  ::avro::encode(e, v.offset);
1195  ::avro::encode(e, v.limit);
1196  ::avro::encode(e, v.encoding);
1197  ::avro::encode(e, v.requestSchemaStr);
1198  ::avro::encode(e, v.data);
1199  ::avro::encode(e, v.options);
1200  }
1201 
1202  static void decode(Decoder& d, gpudb::ExecuteSqlRequest& v)
1203  {
1204  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1205  {
1206  const std::vector<size_t> fo = rd->fieldOrder();
1207 
1208  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1209  {
1210  switch (*it)
1211  {
1212  case 0:
1213  ::avro::decode(d, v.statement);
1214  break;
1215 
1216  case 1:
1217  ::avro::decode(d, v.offset);
1218  break;
1219 
1220  case 2:
1221  ::avro::decode(d, v.limit);
1222  break;
1223 
1224  case 3:
1225  ::avro::decode(d, v.encoding);
1226  break;
1227 
1228  case 4:
1229  ::avro::decode(d, v.requestSchemaStr);
1230  break;
1231 
1232  case 5:
1233  ::avro::decode(d, v.data);
1234  break;
1235 
1236  case 6:
1237  ::avro::decode(d, v.options);
1238  break;
1239 
1240  default:
1241  break;
1242  }
1243  }
1244  }
1245  else
1246  {
1247  ::avro::decode(d, v.statement);
1248  ::avro::decode(d, v.offset);
1249  ::avro::decode(d, v.limit);
1250  ::avro::decode(d, v.encoding);
1251  ::avro::decode(d, v.requestSchemaStr);
1252  ::avro::decode(d, v.data);
1253  ::avro::decode(d, v.options);
1254  }
1255  }
1256  };
1257 } // end namespace avro
1258 
1259 namespace gpudb
1260 {
1267  {
1272  countAffected(int64_t()),
1273  responseSchemaStr(std::string()),
1274  binaryEncodedResponse(std::vector<uint8_t>()),
1275  jsonEncodedResponse(std::string()),
1276  totalNumberOfRecords(int64_t()),
1277  hasMoreRecords(bool()),
1278  pagingTable(std::string()),
1279  info(std::map<std::string, std::string>())
1280  {
1281  }
1282 
1286  int64_t countAffected;
1287 
1292  std::string responseSchemaStr;
1293 
1297  std::vector<uint8_t> binaryEncodedResponse;
1298 
1302  std::string jsonEncodedResponse;
1303 
1308 
1318 
1326  std::string pagingTable;
1327 
1341  std::map<std::string, std::string> info;
1342  };
1343 } // end namespace gpudb
1344 
1345 namespace avro
1346 {
1347  template<> struct codec_traits<gpudb::RawExecuteSqlResponse>
1348  {
1349  static void encode(Encoder& e, const gpudb::RawExecuteSqlResponse& v)
1350  {
1351  ::avro::encode(e, v.countAffected);
1352  ::avro::encode(e, v.responseSchemaStr);
1353  ::avro::encode(e, v.binaryEncodedResponse);
1354  ::avro::encode(e, v.jsonEncodedResponse);
1355  ::avro::encode(e, v.totalNumberOfRecords);
1356  ::avro::encode(e, v.hasMoreRecords);
1357  ::avro::encode(e, v.pagingTable);
1358  ::avro::encode(e, v.info);
1359  }
1360 
1361  static void decode(Decoder& d, gpudb::RawExecuteSqlResponse& v)
1362  {
1363  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
1364  {
1365  const std::vector<size_t> fo = rd->fieldOrder();
1366 
1367  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
1368  {
1369  switch (*it)
1370  {
1371  case 0:
1372  ::avro::decode(d, v.countAffected);
1373  break;
1374 
1375  case 1:
1376  ::avro::decode(d, v.responseSchemaStr);
1377  break;
1378 
1379  case 2:
1380  ::avro::decode(d, v.binaryEncodedResponse);
1381  break;
1382 
1383  case 3:
1384  ::avro::decode(d, v.jsonEncodedResponse);
1385  break;
1386 
1387  case 4:
1388  ::avro::decode(d, v.totalNumberOfRecords);
1389  break;
1390 
1391  case 5:
1392  ::avro::decode(d, v.hasMoreRecords);
1393  break;
1394 
1395  case 6:
1396  ::avro::decode(d, v.pagingTable);
1397  break;
1398 
1399  case 7:
1400  ::avro::decode(d, v.info);
1401  break;
1402 
1403  default:
1404  break;
1405  }
1406  }
1407  }
1408  else
1409  {
1410  ::avro::decode(d, v.countAffected);
1411  ::avro::decode(d, v.responseSchemaStr);
1412  ::avro::decode(d, v.binaryEncodedResponse);
1413  ::avro::decode(d, v.jsonEncodedResponse);
1414  ::avro::decode(d, v.totalNumberOfRecords);
1415  ::avro::decode(d, v.hasMoreRecords);
1416  ::avro::decode(d, v.pagingTable);
1417  ::avro::decode(d, v.info);
1418  }
1419  }
1420  };
1421 } // end namespace avro
1422 
1423 namespace gpudb
1424 {
1430  {
1435  countAffected(int64_t()),
1436  responseSchemaStr(std::string()),
1437  data(std::vector<gpudb::GenericRecord>()),
1438  totalNumberOfRecords(int64_t()),
1439  hasMoreRecords(bool()),
1440  pagingTable(std::string()),
1441  info(std::map<std::string, std::string>()),
1442  dataTypePtr((gpudb::Type*)NULL)
1443  {
1444  }
1445 
1449  int64_t countAffected;
1450 
1454  std::string responseSchemaStr;
1455 
1459  std::vector<gpudb::GenericRecord> data;
1460 
1465 
1475 
1483  std::string pagingTable;
1484 
1498  std::map<std::string, std::string> info;
1499 
1501  };
1502 } // end namespace gpudb
1503 
1504 #endif // __EXECUTE_SQL_H__
gpudb_type_ptr_t dataTypePtr
Definition: execute_sql.h:1500
ExecuteSqlRequest()
Constructs an ExecuteSqlRequest object with default parameters.
Definition: execute_sql.h:46
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:453
boost::shared_ptr< Type > gpudb_type_ptr_t
std::map< std::string, std::string > options
Optional parameters.
Definition: execute_sql.h:1183
std::string pagingTable
Name of the table that has the result records of the query.
Definition: execute_sql.h:1326
std::string encoding
Specifies the encoding for returned records; either 'binary' or 'json'.
Definition: execute_sql.h:921
int64_t countAffected
The number of objects/records affected.
Definition: execute_sql.h:1449
std::string statement
SQL statement (query, DML, or DDL) to be executed.
Definition: execute_sql.h:886
std::vector< gpudb::GenericRecord > data
Avro binary encoded response.
Definition: execute_sql.h:1459
std::string requestSchemaStr
Avro schema of data.
Definition: execute_sql.h:926
bool hasMoreRecords
Too many records.
Definition: execute_sql.h:1317
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: execute_sql.h:1307
int64_t countAffected
The number of objects/records affected.
Definition: execute_sql.h:1286
ExecuteSqlResponse()
Constructs an ExecuteSqlResponse object with default parameters.
Definition: execute_sql.h:1434
std::string jsonEncodedResponse
Avro JSON encoded response.
Definition: execute_sql.h:1302
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:894
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:934
A set of results returned by GPUdb::executeSql.
Definition: execute_sql.h:1429
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: execute_sql.h:1464
A set of results returned by GPUdb::executeSqlRaw.
Definition: execute_sql.h:1266
std::string responseSchemaStr
Avro schema of binaryEncodedResponse or jsonEncodedResponse.
Definition: execute_sql.h:1292
bool hasMoreRecords
Too many records.
Definition: execute_sql.h:1474
A set of parameters for GPUdb::executeSql.
Definition: execute_sql.h:41
std::map< std::string, std::string > info
Additional information.
Definition: execute_sql.h:1498
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:908
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:872
std::map< std::string, std::string > info
Additional information.
Definition: execute_sql.h:1341
std::string pagingTable
Name of the table that has the result records of the query.
Definition: execute_sql.h:1483
RawExecuteSqlResponse()
Constructs a RawExecuteSqlResponse object with default parameters.
Definition: execute_sql.h:1271
std::string responseSchemaStr
Avro schema of data or jsonEncodedResponse.
Definition: execute_sql.h:1454
std::vector< uint8_t > binaryEncodedResponse
Avro binary encoded response.
Definition: execute_sql.h:1297