GPUdb C++ API  Version 6.2.0.3
aggregate_group_by.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 __AGGREGATE_GROUP_BY_H__
7 #define __AGGREGATE_GROUP_BY_H__
8 
9 #include "../GenericRecord.hpp"
10 
11 namespace gpudb
12 {
13 
86  {
87 
93  tableName(std::string()),
94  columnNames(std::vector<std::string>()),
95  offset(int64_t()),
96  limit(int64_t()),
97  encoding(std::string("binary")),
98  options(std::map<std::string, std::string>())
99  {
100  }
101 
278  AggregateGroupByRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
279  tableName( tableName_ ),
280  columnNames( columnNames_ ),
281  offset( offset_ ),
282  limit( limit_ ),
283  encoding( "binary" ),
284  options( options_ )
285  {
286  }
287 
475  AggregateGroupByRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
476  tableName( tableName_ ),
477  columnNames( columnNames_ ),
478  offset( offset_ ),
479  limit( limit_ ),
480  encoding( encoding_ ),
481  options( options_ )
482  {
483  }
484 
485  std::string tableName;
486  std::vector<std::string> columnNames;
487  int64_t offset;
488  int64_t limit;
489  std::string encoding;
490  std::map<std::string, std::string> options;
491  };
492 }
493 
494 namespace avro
495 {
496  template<> struct codec_traits<gpudb::AggregateGroupByRequest>
497  {
498  static void encode(Encoder& e, const gpudb::AggregateGroupByRequest& v)
499  {
500  ::avro::encode(e, v.tableName);
501  ::avro::encode(e, v.columnNames);
502  ::avro::encode(e, v.offset);
503  ::avro::encode(e, v.limit);
504  ::avro::encode(e, v.encoding);
505  ::avro::encode(e, v.options);
506  }
507 
508  static void decode(Decoder& d, gpudb::AggregateGroupByRequest& v)
509  {
510  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
511  {
512  const std::vector<size_t> fo = rd->fieldOrder();
513 
514  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
515  {
516  switch (*it)
517  {
518  case 0:
519  ::avro::decode(d, v.tableName);
520  break;
521 
522  case 1:
523  ::avro::decode(d, v.columnNames);
524  break;
525 
526  case 2:
527  ::avro::decode(d, v.offset);
528  break;
529 
530  case 3:
531  ::avro::decode(d, v.limit);
532  break;
533 
534  case 4:
535  ::avro::decode(d, v.encoding);
536  break;
537 
538  case 5:
539  ::avro::decode(d, v.options);
540  break;
541 
542  default:
543  break;
544  }
545  }
546  }
547  else
548  {
549  ::avro::decode(d, v.tableName);
550  ::avro::decode(d, v.columnNames);
551  ::avro::decode(d, v.offset);
552  ::avro::decode(d, v.limit);
553  ::avro::decode(d, v.encoding);
554  ::avro::decode(d, v.options);
555  }
556  }
557  };
558 }
559 
560 namespace gpudb
561 {
562 
635  {
636 
642  responseSchemaStr(std::string()),
643  binaryEncodedResponse(std::vector<uint8_t>()),
644  jsonEncodedResponse(std::string()),
645  totalNumberOfRecords(int64_t()),
646  hasMoreRecords(bool())
647  {
648  }
649 
650  std::string responseSchemaStr;
651  std::vector<uint8_t> binaryEncodedResponse;
652  std::string jsonEncodedResponse;
655  };
656 }
657 
658 namespace avro
659 {
660  template<> struct codec_traits<gpudb::RawAggregateGroupByResponse>
661  {
662  static void encode(Encoder& e, const gpudb::RawAggregateGroupByResponse& v)
663  {
664  ::avro::encode(e, v.responseSchemaStr);
665  ::avro::encode(e, v.binaryEncodedResponse);
666  ::avro::encode(e, v.jsonEncodedResponse);
667  ::avro::encode(e, v.totalNumberOfRecords);
668  ::avro::encode(e, v.hasMoreRecords);
669  }
670 
671  static void decode(Decoder& d, gpudb::RawAggregateGroupByResponse& v)
672  {
673  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
674  {
675  const std::vector<size_t> fo = rd->fieldOrder();
676 
677  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
678  {
679  switch (*it)
680  {
681  case 0:
682  ::avro::decode(d, v.responseSchemaStr);
683  break;
684 
685  case 1:
686  ::avro::decode(d, v.binaryEncodedResponse);
687  break;
688 
689  case 2:
690  ::avro::decode(d, v.jsonEncodedResponse);
691  break;
692 
693  case 3:
694  ::avro::decode(d, v.totalNumberOfRecords);
695  break;
696 
697  case 4:
698  ::avro::decode(d, v.hasMoreRecords);
699  break;
700 
701  default:
702  break;
703  }
704  }
705  }
706  else
707  {
708  ::avro::decode(d, v.responseSchemaStr);
709  ::avro::decode(d, v.binaryEncodedResponse);
710  ::avro::decode(d, v.jsonEncodedResponse);
711  ::avro::decode(d, v.totalNumberOfRecords);
712  ::avro::decode(d, v.hasMoreRecords);
713  }
714  }
715  };
716 }
717 
718 namespace gpudb
719 {
720 
793  {
794 
800  responseSchemaStr(std::string()),
801  data(std::vector<gpudb::GenericRecord>()),
802  totalNumberOfRecords(int64_t()),
803  hasMoreRecords(bool()),
804  dataTypePtr((gpudb::Type*)NULL)
805  {
806  }
807 
808  std::string responseSchemaStr;
809  std::vector<gpudb::GenericRecord> data;
813  };
814 }
815 
816 #endif
A set of output parameters for aggregateGroupByRaw(const AggregateGroupByRequest&) const...
AggregateGroupByRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs an AggregateGroupByRequest object with the specified parameters.
boost::shared_ptr< Type > gpudb_type_ptr_t
A set of input parameters for aggregateGroupByRaw(const AggregateGroupByRequest&) const...
AggregateGroupByResponse()
Constructs an AggregateGroupByResponse object with default parameter values.
std::vector< std::string > columnNames
AggregateGroupByRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs an AggregateGroupByRequest object with the specified parameters.
std::vector< uint8_t > binaryEncodedResponse
AggregateGroupByRequest()
Constructs an AggregateGroupByRequest object with default parameter values.
A set of output parameters for aggregateGroupBy(const AggregateGroupByRequest&) const.
RawAggregateGroupByResponse()
Constructs a RawAggregateGroupByResponse object with default parameter values.
std::map< std::string, std::string > options
std::vector< gpudb::GenericRecord > data