GPUdb C++ API  Version 6.1.0.0
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 
67  {
68 
74  tableName(std::string()),
75  columnNames(std::vector<std::string>()),
76  offset(int64_t()),
77  limit(int64_t()),
78  encoding(std::string("binary")),
79  options(std::map<std::string, std::string>())
80  {
81  }
82 
216  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_):
217  tableName( tableName_ ),
218  columnNames( columnNames_ ),
219  offset( offset_ ),
220  limit( limit_ ),
221  encoding( "binary" ),
222  options( options_ )
223  {
224  }
225 
370  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_):
371  tableName( tableName_ ),
372  columnNames( columnNames_ ),
373  offset( offset_ ),
374  limit( limit_ ),
375  encoding( encoding_ ),
376  options( options_ )
377  {
378  }
379 
380  std::string tableName;
381  std::vector<std::string> columnNames;
382  int64_t offset;
383  int64_t limit;
384  std::string encoding;
385  std::map<std::string, std::string> options;
386  };
387 }
388 
389 namespace avro
390 {
391  template<> struct codec_traits<gpudb::AggregateGroupByRequest>
392  {
393  static void encode(Encoder& e, const gpudb::AggregateGroupByRequest& v)
394  {
395  ::avro::encode(e, v.tableName);
396  ::avro::encode(e, v.columnNames);
397  ::avro::encode(e, v.offset);
398  ::avro::encode(e, v.limit);
399  ::avro::encode(e, v.encoding);
400  ::avro::encode(e, v.options);
401  }
402 
403  static void decode(Decoder& d, gpudb::AggregateGroupByRequest& v)
404  {
405  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
406  {
407  const std::vector<size_t> fo = rd->fieldOrder();
408 
409  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
410  {
411  switch (*it)
412  {
413  case 0:
414  ::avro::decode(d, v.tableName);
415  break;
416 
417  case 1:
418  ::avro::decode(d, v.columnNames);
419  break;
420 
421  case 2:
422  ::avro::decode(d, v.offset);
423  break;
424 
425  case 3:
426  ::avro::decode(d, v.limit);
427  break;
428 
429  case 4:
430  ::avro::decode(d, v.encoding);
431  break;
432 
433  case 5:
434  ::avro::decode(d, v.options);
435  break;
436 
437  default:
438  break;
439  }
440  }
441  }
442  else
443  {
444  ::avro::decode(d, v.tableName);
445  ::avro::decode(d, v.columnNames);
446  ::avro::decode(d, v.offset);
447  ::avro::decode(d, v.limit);
448  ::avro::decode(d, v.encoding);
449  ::avro::decode(d, v.options);
450  }
451  }
452  };
453 }
454 
455 namespace gpudb
456 {
457 
511  {
512 
518  responseSchemaStr(std::string()),
519  binaryEncodedResponse(std::vector<uint8_t>()),
520  jsonEncodedResponse(std::string()),
521  totalNumberOfRecords(int64_t()),
522  hasMoreRecords(bool())
523  {
524  }
525 
526  std::string responseSchemaStr;
527  std::vector<uint8_t> binaryEncodedResponse;
528  std::string jsonEncodedResponse;
531  };
532 }
533 
534 namespace avro
535 {
536  template<> struct codec_traits<gpudb::RawAggregateGroupByResponse>
537  {
538  static void encode(Encoder& e, const gpudb::RawAggregateGroupByResponse& v)
539  {
540  ::avro::encode(e, v.responseSchemaStr);
541  ::avro::encode(e, v.binaryEncodedResponse);
542  ::avro::encode(e, v.jsonEncodedResponse);
543  ::avro::encode(e, v.totalNumberOfRecords);
544  ::avro::encode(e, v.hasMoreRecords);
545  }
546 
547  static void decode(Decoder& d, gpudb::RawAggregateGroupByResponse& v)
548  {
549  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
550  {
551  const std::vector<size_t> fo = rd->fieldOrder();
552 
553  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
554  {
555  switch (*it)
556  {
557  case 0:
558  ::avro::decode(d, v.responseSchemaStr);
559  break;
560 
561  case 1:
562  ::avro::decode(d, v.binaryEncodedResponse);
563  break;
564 
565  case 2:
566  ::avro::decode(d, v.jsonEncodedResponse);
567  break;
568 
569  case 3:
570  ::avro::decode(d, v.totalNumberOfRecords);
571  break;
572 
573  case 4:
574  ::avro::decode(d, v.hasMoreRecords);
575  break;
576 
577  default:
578  break;
579  }
580  }
581  }
582  else
583  {
584  ::avro::decode(d, v.responseSchemaStr);
585  ::avro::decode(d, v.binaryEncodedResponse);
586  ::avro::decode(d, v.jsonEncodedResponse);
587  ::avro::decode(d, v.totalNumberOfRecords);
588  ::avro::decode(d, v.hasMoreRecords);
589  }
590  }
591  };
592 }
593 
594 namespace gpudb
595 {
596 
650  {
651 
657  responseSchemaStr(std::string()),
658  data(std::vector<gpudb::GenericRecord>()),
659  totalNumberOfRecords(int64_t()),
660  hasMoreRecords(bool())
661  {
662  }
663 
664  std::string responseSchemaStr;
665  std::vector<gpudb::GenericRecord> data;
668  };
669 }
670 
671 #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.
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