GPUdb C++ API  Version 6.0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
189  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_):
190  tableName( tableName_ ),
191  columnNames( columnNames_ ),
192  offset( offset_ ),
193  limit( limit_ ),
194  encoding( "binary" ),
195  options( options_ )
196  {
197  }
198 
314  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_):
315  tableName( tableName_ ),
316  columnNames( columnNames_ ),
317  offset( offset_ ),
318  limit( limit_ ),
319  encoding( encoding_ ),
320  options( options_ )
321  {
322  }
323 
324  std::string tableName;
325  std::vector<std::string> columnNames;
326  int64_t offset;
327  int64_t limit;
328  std::string encoding;
329  std::map<std::string, std::string> options;
330  };
331 }
332 
333 namespace avro
334 {
335  template<> struct codec_traits<gpudb::AggregateGroupByRequest>
336  {
337  static void encode(Encoder& e, const gpudb::AggregateGroupByRequest& v)
338  {
339  ::avro::encode(e, v.tableName);
340  ::avro::encode(e, v.columnNames);
341  ::avro::encode(e, v.offset);
342  ::avro::encode(e, v.limit);
343  ::avro::encode(e, v.encoding);
344  ::avro::encode(e, v.options);
345  }
346 
347  static void decode(Decoder& d, gpudb::AggregateGroupByRequest& v)
348  {
349  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
350  {
351  const std::vector<size_t> fo = rd->fieldOrder();
352 
353  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
354  {
355  switch (*it)
356  {
357  case 0:
358  ::avro::decode(d, v.tableName);
359  break;
360 
361  case 1:
362  ::avro::decode(d, v.columnNames);
363  break;
364 
365  case 2:
366  ::avro::decode(d, v.offset);
367  break;
368 
369  case 3:
370  ::avro::decode(d, v.limit);
371  break;
372 
373  case 4:
374  ::avro::decode(d, v.encoding);
375  break;
376 
377  case 5:
378  ::avro::decode(d, v.options);
379  break;
380 
381  default:
382  break;
383  }
384  }
385  }
386  else
387  {
388  ::avro::decode(d, v.tableName);
389  ::avro::decode(d, v.columnNames);
390  ::avro::decode(d, v.offset);
391  ::avro::decode(d, v.limit);
392  ::avro::decode(d, v.encoding);
393  ::avro::decode(d, v.options);
394  }
395  }
396  };
397 }
398 
399 namespace gpudb
400 {
401 
455  {
456 
462  responseSchemaStr(std::string()),
463  binaryEncodedResponse(std::vector<uint8_t>()),
464  jsonEncodedResponse(std::string()),
465  totalNumberOfRecords(int64_t()),
466  hasMoreRecords(bool())
467  {
468  }
469 
470  std::string responseSchemaStr;
471  std::vector<uint8_t> binaryEncodedResponse;
472  std::string jsonEncodedResponse;
475  };
476 }
477 
478 namespace avro
479 {
480  template<> struct codec_traits<gpudb::RawAggregateGroupByResponse>
481  {
482  static void encode(Encoder& e, const gpudb::RawAggregateGroupByResponse& v)
483  {
484  ::avro::encode(e, v.responseSchemaStr);
485  ::avro::encode(e, v.binaryEncodedResponse);
486  ::avro::encode(e, v.jsonEncodedResponse);
487  ::avro::encode(e, v.totalNumberOfRecords);
488  ::avro::encode(e, v.hasMoreRecords);
489  }
490 
491  static void decode(Decoder& d, gpudb::RawAggregateGroupByResponse& v)
492  {
493  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
494  {
495  const std::vector<size_t> fo = rd->fieldOrder();
496 
497  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
498  {
499  switch (*it)
500  {
501  case 0:
502  ::avro::decode(d, v.responseSchemaStr);
503  break;
504 
505  case 1:
506  ::avro::decode(d, v.binaryEncodedResponse);
507  break;
508 
509  case 2:
510  ::avro::decode(d, v.jsonEncodedResponse);
511  break;
512 
513  case 3:
514  ::avro::decode(d, v.totalNumberOfRecords);
515  break;
516 
517  case 4:
518  ::avro::decode(d, v.hasMoreRecords);
519  break;
520 
521  default:
522  break;
523  }
524  }
525  }
526  else
527  {
528  ::avro::decode(d, v.responseSchemaStr);
529  ::avro::decode(d, v.binaryEncodedResponse);
530  ::avro::decode(d, v.jsonEncodedResponse);
531  ::avro::decode(d, v.totalNumberOfRecords);
532  ::avro::decode(d, v.hasMoreRecords);
533  }
534  }
535  };
536 }
537 
538 namespace gpudb
539 {
540 
594  {
595 
601  responseSchemaStr(std::string()),
602  data(std::vector<gpudb::GenericRecord>()),
603  totalNumberOfRecords(int64_t()),
604  hasMoreRecords(bool())
605  {
606  }
607 
608  std::string responseSchemaStr;
609  std::vector<gpudb::GenericRecord> data;
612  };
613 }
614 
615 #endif
A set of output parameters for 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 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 const.
RawAggregateGroupByResponse()
Constructs a RawAggregateGroupByResponse object with default parameter values.
std::map< std::string, std::string > options
std::vector< gpudb::GenericRecord > data