GPUdb C++ API  Version 7.1.10.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 
24  {
25 
31  statement(std::string()),
32  offset(int64_t()),
33  limit(int64_t()),
34  encoding(std::string("binary")),
35  requestSchemaStr(std::string()),
36  data(std::vector<std::vector<uint8_t> >()),
37  options(std::map<std::string, std::string>())
38  {
39  }
40 
282  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_):
283  statement( statement_ ),
284  offset( offset_ ),
285  limit( limit_ ),
286  encoding( "binary" ),
287  requestSchemaStr( requestSchemaStr_ ),
288  data( data_ ),
289  options( options_ )
290  {
291  }
292 
542  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_):
543  statement( statement_ ),
544  offset( offset_ ),
545  limit( limit_ ),
546  encoding( encoding_ ),
547  requestSchemaStr( requestSchemaStr_ ),
548  data( data_ ),
549  options( options_ )
550  {
551  }
552 
553  std::string statement;
554  int64_t offset;
555  int64_t limit;
556  std::string encoding;
557  std::string requestSchemaStr;
558  std::vector<std::vector<uint8_t> > data;
559  std::map<std::string, std::string> options;
560  };
561 }
562 
563 namespace avro
564 {
565  template<> struct codec_traits<gpudb::ExecuteSqlRequest>
566  {
567  static void encode(Encoder& e, const gpudb::ExecuteSqlRequest& v)
568  {
569  ::avro::encode(e, v.statement);
570  ::avro::encode(e, v.offset);
571  ::avro::encode(e, v.limit);
572  ::avro::encode(e, v.encoding);
573  ::avro::encode(e, v.requestSchemaStr);
574  ::avro::encode(e, v.data);
575  ::avro::encode(e, v.options);
576  }
577 
578  static void decode(Decoder& d, gpudb::ExecuteSqlRequest& v)
579  {
580  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
581  {
582  const std::vector<size_t> fo = rd->fieldOrder();
583 
584  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
585  {
586  switch (*it)
587  {
588  case 0:
589  ::avro::decode(d, v.statement);
590  break;
591 
592  case 1:
593  ::avro::decode(d, v.offset);
594  break;
595 
596  case 2:
597  ::avro::decode(d, v.limit);
598  break;
599 
600  case 3:
601  ::avro::decode(d, v.encoding);
602  break;
603 
604  case 4:
605  ::avro::decode(d, v.requestSchemaStr);
606  break;
607 
608  case 5:
609  ::avro::decode(d, v.data);
610  break;
611 
612  case 6:
613  ::avro::decode(d, v.options);
614  break;
615 
616  default:
617  break;
618  }
619  }
620  }
621  else
622  {
623  ::avro::decode(d, v.statement);
624  ::avro::decode(d, v.offset);
625  ::avro::decode(d, v.limit);
626  ::avro::decode(d, v.encoding);
627  ::avro::decode(d, v.requestSchemaStr);
628  ::avro::decode(d, v.data);
629  ::avro::decode(d, v.options);
630  }
631  }
632  };
633 }
634 
635 namespace gpudb
636 {
637 
648  {
649 
655  countAffected(int64_t()),
656  responseSchemaStr(std::string()),
657  binaryEncodedResponse(std::vector<uint8_t>()),
658  jsonEncodedResponse(std::string()),
659  totalNumberOfRecords(int64_t()),
660  hasMoreRecords(bool()),
661  pagingTable(std::string()),
662  info(std::map<std::string, std::string>())
663  {
664  }
665 
666  int64_t countAffected;
667  std::string responseSchemaStr;
668  std::vector<uint8_t> binaryEncodedResponse;
669  std::string jsonEncodedResponse;
672  std::string pagingTable;
673  std::map<std::string, std::string> info;
674  };
675 }
676 
677 namespace avro
678 {
679  template<> struct codec_traits<gpudb::RawExecuteSqlResponse>
680  {
681  static void encode(Encoder& e, const gpudb::RawExecuteSqlResponse& v)
682  {
683  ::avro::encode(e, v.countAffected);
684  ::avro::encode(e, v.responseSchemaStr);
685  ::avro::encode(e, v.binaryEncodedResponse);
686  ::avro::encode(e, v.jsonEncodedResponse);
687  ::avro::encode(e, v.totalNumberOfRecords);
688  ::avro::encode(e, v.hasMoreRecords);
689  ::avro::encode(e, v.pagingTable);
690  ::avro::encode(e, v.info);
691  }
692 
693  static void decode(Decoder& d, gpudb::RawExecuteSqlResponse& v)
694  {
695  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
696  {
697  const std::vector<size_t> fo = rd->fieldOrder();
698 
699  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
700  {
701  switch (*it)
702  {
703  case 0:
704  ::avro::decode(d, v.countAffected);
705  break;
706 
707  case 1:
708  ::avro::decode(d, v.responseSchemaStr);
709  break;
710 
711  case 2:
712  ::avro::decode(d, v.binaryEncodedResponse);
713  break;
714 
715  case 3:
716  ::avro::decode(d, v.jsonEncodedResponse);
717  break;
718 
719  case 4:
720  ::avro::decode(d, v.totalNumberOfRecords);
721  break;
722 
723  case 5:
724  ::avro::decode(d, v.hasMoreRecords);
725  break;
726 
727  case 6:
728  ::avro::decode(d, v.pagingTable);
729  break;
730 
731  case 7:
732  ::avro::decode(d, v.info);
733  break;
734 
735  default:
736  break;
737  }
738  }
739  }
740  else
741  {
742  ::avro::decode(d, v.countAffected);
743  ::avro::decode(d, v.responseSchemaStr);
744  ::avro::decode(d, v.binaryEncodedResponse);
745  ::avro::decode(d, v.jsonEncodedResponse);
746  ::avro::decode(d, v.totalNumberOfRecords);
747  ::avro::decode(d, v.hasMoreRecords);
748  ::avro::decode(d, v.pagingTable);
749  ::avro::decode(d, v.info);
750  }
751  }
752  };
753 }
754 
755 namespace gpudb
756 {
757 
768  {
769 
775  countAffected(int64_t()),
776  responseSchemaStr(std::string()),
777  data(std::vector<gpudb::GenericRecord>()),
778  totalNumberOfRecords(int64_t()),
779  hasMoreRecords(bool()),
780  pagingTable(std::string()),
781  info(std::map<std::string, std::string>()),
782  dataTypePtr((gpudb::Type*)NULL)
783  {
784  }
785 
786  int64_t countAffected;
787  std::string responseSchemaStr;
788  std::vector<gpudb::GenericRecord> data;
791  std::string pagingTable;
792  std::map<std::string, std::string> info;
794  };
795 }
796 
797 #endif
gpudb_type_ptr_t dataTypePtr
Definition: execute_sql.h:793
ExecuteSqlRequest()
Constructs an ExecuteSqlRequest object with default parameter values.
Definition: execute_sql.h:30
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:282
boost::shared_ptr< Type > gpudb_type_ptr_t
std::map< std::string, std::string > options
Definition: execute_sql.h:559
std::vector< gpudb::GenericRecord > data
Definition: execute_sql.h:788
std::string requestSchemaStr
Definition: execute_sql.h:557
ExecuteSqlResponse()
Constructs an ExecuteSqlResponse object with default parameter values.
Definition: execute_sql.h:774
std::vector< std::vector< uint8_t > > data
Definition: execute_sql.h:558
A set of output parameters for const.
Definition: execute_sql.h:767
A set of output parameters for const.
Definition: execute_sql.h:647
A set of input parameters for const.
Definition: execute_sql.h:23
std::map< std::string, std::string > info
Definition: execute_sql.h:792
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:542
std::map< std::string, std::string > info
Definition: execute_sql.h:673
RawExecuteSqlResponse()
Constructs a RawExecuteSqlResponse object with default parameter values.
Definition: execute_sql.h:654
std::string responseSchemaStr
Definition: execute_sql.h:787
std::vector< uint8_t > binaryEncodedResponse
Definition: execute_sql.h:668