GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
execute_sql.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the GPUdb 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 {
13 
21  {
22 
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 
220  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_):
221  statement( statement_ ),
222  offset( offset_ ),
223  limit( limit_ ),
224  encoding( "binary" ),
225  requestSchemaStr( requestSchemaStr_ ),
226  data( data_ ),
227  options( options_ )
228  {
229  }
230 
421  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_):
422  statement( statement_ ),
423  offset( offset_ ),
424  limit( limit_ ),
425  encoding( encoding_ ),
426  requestSchemaStr( requestSchemaStr_ ),
427  data( data_ ),
428  options( options_ )
429  {
430  }
431 
432  std::string statement;
433  int64_t offset;
434  int64_t limit;
435  std::string encoding;
436  std::string requestSchemaStr;
437  std::vector<std::vector<uint8_t> > data;
438  std::map<std::string, std::string> options;
439  };
440 }
441 
442 namespace avro
443 {
444  template<> struct codec_traits<gpudb::ExecuteSqlRequest>
445  {
446  static void encode(Encoder& e, const gpudb::ExecuteSqlRequest& v)
447  {
448  ::avro::encode(e, v.statement);
449  ::avro::encode(e, v.offset);
450  ::avro::encode(e, v.limit);
451  ::avro::encode(e, v.encoding);
452  ::avro::encode(e, v.requestSchemaStr);
453  ::avro::encode(e, v.data);
454  ::avro::encode(e, v.options);
455  }
456 
457  static void decode(Decoder& d, gpudb::ExecuteSqlRequest& v)
458  {
459  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
460  {
461  const std::vector<size_t> fo = rd->fieldOrder();
462 
463  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
464  {
465  switch (*it)
466  {
467  case 0:
468  ::avro::decode(d, v.statement);
469  break;
470 
471  case 1:
472  ::avro::decode(d, v.offset);
473  break;
474 
475  case 2:
476  ::avro::decode(d, v.limit);
477  break;
478 
479  case 3:
480  ::avro::decode(d, v.encoding);
481  break;
482 
483  case 4:
484  ::avro::decode(d, v.requestSchemaStr);
485  break;
486 
487  case 5:
488  ::avro::decode(d, v.data);
489  break;
490 
491  case 6:
492  ::avro::decode(d, v.options);
493  break;
494 
495  default:
496  break;
497  }
498  }
499  }
500  else
501  {
502  ::avro::decode(d, v.statement);
503  ::avro::decode(d, v.offset);
504  ::avro::decode(d, v.limit);
505  ::avro::decode(d, v.encoding);
506  ::avro::decode(d, v.requestSchemaStr);
507  ::avro::decode(d, v.data);
508  ::avro::decode(d, v.options);
509  }
510  }
511  };
512 }
513 
514 namespace gpudb
515 {
516 
524  {
525 
531  countAffected(int64_t()),
532  responseSchemaStr(std::string()),
533  binaryEncodedResponse(std::vector<uint8_t>()),
534  jsonEncodedResponse(std::string()),
535  totalNumberOfRecords(int64_t()),
536  hasMoreRecords(bool()),
537  pagingTable(std::string()),
538  info(std::map<std::string, std::string>())
539  {
540  }
541 
542  int64_t countAffected;
543  std::string responseSchemaStr;
544  std::vector<uint8_t> binaryEncodedResponse;
545  std::string jsonEncodedResponse;
548  std::string pagingTable;
549  std::map<std::string, std::string> info;
550  };
551 }
552 
553 namespace avro
554 {
555  template<> struct codec_traits<gpudb::RawExecuteSqlResponse>
556  {
557  static void encode(Encoder& e, const gpudb::RawExecuteSqlResponse& v)
558  {
559  ::avro::encode(e, v.countAffected);
560  ::avro::encode(e, v.responseSchemaStr);
561  ::avro::encode(e, v.binaryEncodedResponse);
562  ::avro::encode(e, v.jsonEncodedResponse);
563  ::avro::encode(e, v.totalNumberOfRecords);
564  ::avro::encode(e, v.hasMoreRecords);
565  ::avro::encode(e, v.pagingTable);
566  ::avro::encode(e, v.info);
567  }
568 
569  static void decode(Decoder& d, gpudb::RawExecuteSqlResponse& v)
570  {
571  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
572  {
573  const std::vector<size_t> fo = rd->fieldOrder();
574 
575  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
576  {
577  switch (*it)
578  {
579  case 0:
580  ::avro::decode(d, v.countAffected);
581  break;
582 
583  case 1:
584  ::avro::decode(d, v.responseSchemaStr);
585  break;
586 
587  case 2:
588  ::avro::decode(d, v.binaryEncodedResponse);
589  break;
590 
591  case 3:
592  ::avro::decode(d, v.jsonEncodedResponse);
593  break;
594 
595  case 4:
596  ::avro::decode(d, v.totalNumberOfRecords);
597  break;
598 
599  case 5:
600  ::avro::decode(d, v.hasMoreRecords);
601  break;
602 
603  case 6:
604  ::avro::decode(d, v.pagingTable);
605  break;
606 
607  case 7:
608  ::avro::decode(d, v.info);
609  break;
610 
611  default:
612  break;
613  }
614  }
615  }
616  else
617  {
618  ::avro::decode(d, v.countAffected);
619  ::avro::decode(d, v.responseSchemaStr);
620  ::avro::decode(d, v.binaryEncodedResponse);
621  ::avro::decode(d, v.jsonEncodedResponse);
622  ::avro::decode(d, v.totalNumberOfRecords);
623  ::avro::decode(d, v.hasMoreRecords);
624  ::avro::decode(d, v.pagingTable);
625  ::avro::decode(d, v.info);
626  }
627  }
628  };
629 }
630 
631 namespace gpudb
632 {
633 
641  {
642 
648  countAffected(int64_t()),
649  responseSchemaStr(std::string()),
650  data(std::vector<gpudb::GenericRecord>()),
651  totalNumberOfRecords(int64_t()),
652  hasMoreRecords(bool()),
653  pagingTable(std::string()),
654  info(std::map<std::string, std::string>()),
655  dataTypePtr((gpudb::Type*)NULL)
656  {
657  }
658 
659  int64_t countAffected;
660  std::string responseSchemaStr;
661  std::vector<gpudb::GenericRecord> data;
664  std::string pagingTable;
665  std::map<std::string, std::string> info;
667  };
668 }
669 
670 #endif
gpudb_type_ptr_t dataTypePtr
Definition: execute_sql.h:666
ExecuteSqlRequest()
Constructs an ExecuteSqlRequest object with default parameter values.
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:220
boost::shared_ptr< Type > gpudb_type_ptr_t
std::map< std::string, std::string > options
Definition: execute_sql.h:438
std::vector< gpudb::GenericRecord > data
Definition: execute_sql.h:661
std::string requestSchemaStr
Definition: execute_sql.h:436
ExecuteSqlResponse()
Constructs an ExecuteSqlResponse object with default parameter values.
Definition: execute_sql.h:647
std::vector< std::vector< uint8_t > > data
Definition: execute_sql.h:437
A set of output parameters for const.
Definition: execute_sql.h:640
A set of output parameters for const.
Definition: execute_sql.h:523
A set of input parameters for const.
Definition: execute_sql.h:20
std::map< std::string, std::string > info
Definition: execute_sql.h:665
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:421
std::map< std::string, std::string > info
Definition: execute_sql.h:549
RawExecuteSqlResponse()
Constructs a RawExecuteSqlResponse object with default parameter values.
Definition: execute_sql.h:530
std::string responseSchemaStr
Definition: execute_sql.h:660
std::vector< uint8_t > binaryEncodedResponse
Definition: execute_sql.h:544