GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
aggregate_unpivot.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_UNPIVOT_H__
7 #define __AGGREGATE_UNPIVOT_H__
8 
9 #include "../GenericRecord.hpp"
10 
11 namespace gpudb
12 {
13 
43  {
44 
50  tableName(std::string()),
51  columnNames(std::vector<std::string>()),
52  variableColumnName(std::string()),
53  valueColumnName(std::string()),
54  pivotedColumns(std::vector<std::string>()),
55  encoding(std::string("binary")),
56  options(std::map<std::string, std::string>())
57  {
58  }
59 
181  AggregateUnpivotRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const std::string& variableColumnName_, const std::string& valueColumnName_, const std::vector<std::string>& pivotedColumns_, const std::map<std::string, std::string>& options_):
182  tableName( tableName_ ),
183  columnNames( columnNames_ ),
184  variableColumnName( variableColumnName_ ),
185  valueColumnName( valueColumnName_ ),
186  pivotedColumns( pivotedColumns_ ),
187  encoding( "binary" ),
188  options( options_ )
189  {
190  }
191 
324  AggregateUnpivotRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const std::string& variableColumnName_, const std::string& valueColumnName_, const std::vector<std::string>& pivotedColumns_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
325  tableName( tableName_ ),
326  columnNames( columnNames_ ),
327  variableColumnName( variableColumnName_ ),
328  valueColumnName( valueColumnName_ ),
329  pivotedColumns( pivotedColumns_ ),
330  encoding( encoding_ ),
331  options( options_ )
332  {
333  }
334 
335  std::string tableName;
336  std::vector<std::string> columnNames;
337  std::string variableColumnName;
338  std::string valueColumnName;
339  std::vector<std::string> pivotedColumns;
340  std::string encoding;
341  std::map<std::string, std::string> options;
342  };
343 }
344 
345 namespace avro
346 {
347  template<> struct codec_traits<gpudb::AggregateUnpivotRequest>
348  {
349  static void encode(Encoder& e, const gpudb::AggregateUnpivotRequest& v)
350  {
351  ::avro::encode(e, v.tableName);
352  ::avro::encode(e, v.columnNames);
353  ::avro::encode(e, v.variableColumnName);
354  ::avro::encode(e, v.valueColumnName);
355  ::avro::encode(e, v.pivotedColumns);
356  ::avro::encode(e, v.encoding);
357  ::avro::encode(e, v.options);
358  }
359 
360  static void decode(Decoder& d, gpudb::AggregateUnpivotRequest& v)
361  {
362  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
363  {
364  const std::vector<size_t> fo = rd->fieldOrder();
365 
366  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
367  {
368  switch (*it)
369  {
370  case 0:
371  ::avro::decode(d, v.tableName);
372  break;
373 
374  case 1:
375  ::avro::decode(d, v.columnNames);
376  break;
377 
378  case 2:
379  ::avro::decode(d, v.variableColumnName);
380  break;
381 
382  case 3:
383  ::avro::decode(d, v.valueColumnName);
384  break;
385 
386  case 4:
387  ::avro::decode(d, v.pivotedColumns);
388  break;
389 
390  case 5:
391  ::avro::decode(d, v.encoding);
392  break;
393 
394  case 6:
395  ::avro::decode(d, v.options);
396  break;
397 
398  default:
399  break;
400  }
401  }
402  }
403  else
404  {
405  ::avro::decode(d, v.tableName);
406  ::avro::decode(d, v.columnNames);
407  ::avro::decode(d, v.variableColumnName);
408  ::avro::decode(d, v.valueColumnName);
409  ::avro::decode(d, v.pivotedColumns);
410  ::avro::decode(d, v.encoding);
411  ::avro::decode(d, v.options);
412  }
413  }
414  };
415 }
416 
417 namespace gpudb
418 {
419 
449  {
450 
456  tableName(std::string()),
457  responseSchemaStr(std::string()),
458  binaryEncodedResponse(std::vector<uint8_t>()),
459  jsonEncodedResponse(std::string()),
460  totalNumberOfRecords(int64_t()),
461  hasMoreRecords(bool()),
462  info(std::map<std::string, std::string>())
463  {
464  }
465 
466  std::string tableName;
467  std::string responseSchemaStr;
468  std::vector<uint8_t> binaryEncodedResponse;
469  std::string jsonEncodedResponse;
472  std::map<std::string, std::string> info;
473  };
474 }
475 
476 namespace avro
477 {
478  template<> struct codec_traits<gpudb::RawAggregateUnpivotResponse>
479  {
480  static void encode(Encoder& e, const gpudb::RawAggregateUnpivotResponse& v)
481  {
482  ::avro::encode(e, v.tableName);
483  ::avro::encode(e, v.responseSchemaStr);
484  ::avro::encode(e, v.binaryEncodedResponse);
485  ::avro::encode(e, v.jsonEncodedResponse);
486  ::avro::encode(e, v.totalNumberOfRecords);
487  ::avro::encode(e, v.hasMoreRecords);
488  ::avro::encode(e, v.info);
489  }
490 
491  static void decode(Decoder& d, gpudb::RawAggregateUnpivotResponse& 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.tableName);
503  break;
504 
505  case 1:
506  ::avro::decode(d, v.responseSchemaStr);
507  break;
508 
509  case 2:
510  ::avro::decode(d, v.binaryEncodedResponse);
511  break;
512 
513  case 3:
514  ::avro::decode(d, v.jsonEncodedResponse);
515  break;
516 
517  case 4:
518  ::avro::decode(d, v.totalNumberOfRecords);
519  break;
520 
521  case 5:
522  ::avro::decode(d, v.hasMoreRecords);
523  break;
524 
525  case 6:
526  ::avro::decode(d, v.info);
527  break;
528 
529  default:
530  break;
531  }
532  }
533  }
534  else
535  {
536  ::avro::decode(d, v.tableName);
537  ::avro::decode(d, v.responseSchemaStr);
538  ::avro::decode(d, v.binaryEncodedResponse);
539  ::avro::decode(d, v.jsonEncodedResponse);
540  ::avro::decode(d, v.totalNumberOfRecords);
541  ::avro::decode(d, v.hasMoreRecords);
542  ::avro::decode(d, v.info);
543  }
544  }
545  };
546 }
547 
548 namespace gpudb
549 {
550 
580  {
581 
587  tableName(std::string()),
588  responseSchemaStr(std::string()),
589  data(std::vector<gpudb::GenericRecord>()),
590  totalNumberOfRecords(int64_t()),
591  hasMoreRecords(bool()),
592  info(std::map<std::string, std::string>()),
593  dataTypePtr((gpudb::Type*)NULL)
594  {
595  }
596 
597  std::string tableName;
598  std::string responseSchemaStr;
599  std::vector<gpudb::GenericRecord> data;
602  std::map<std::string, std::string> info;
604  };
605 }
606 
607 #endif
boost::shared_ptr< Type > gpudb_type_ptr_t
std::map< std::string, std::string > info
std::vector< std::string > columnNames
std::vector< uint8_t > binaryEncodedResponse
AggregateUnpivotRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const std::string &variableColumnName_, const std::string &valueColumnName_, const std::vector< std::string > &pivotedColumns_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs an AggregateUnpivotRequest object with the specified parameters.
A set of output parameters for const.
RawAggregateUnpivotResponse()
Constructs a RawAggregateUnpivotResponse object with default parameter values.
std::map< std::string, std::string > info
AggregateUnpivotRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const std::string &variableColumnName_, const std::string &valueColumnName_, const std::vector< std::string > &pivotedColumns_, const std::map< std::string, std::string > &options_)
Constructs an AggregateUnpivotRequest object with the specified parameters.
AggregateUnpivotRequest()
Constructs an AggregateUnpivotRequest object with default parameter values.
A set of output parameters for const.
std::vector< gpudb::GenericRecord > data
std::map< std::string, std::string > options
AggregateUnpivotResponse()
Constructs an AggregateUnpivotResponse object with default parameter values.
A set of input parameters for const.
std::vector< std::string > pivotedColumns