GPUdb C++ API  Version 7.0.19.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 
37  {
38 
44  tableName(std::string()),
45  columnNames(std::vector<std::string>()),
46  variableColumnName(std::string()),
47  valueColumnName(std::string()),
48  pivotedColumns(std::vector<std::string>()),
49  encoding(std::string("binary")),
50  options(std::map<std::string, std::string>())
51  {
52  }
53 
166  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_):
167  tableName( tableName_ ),
168  columnNames( columnNames_ ),
169  variableColumnName( variableColumnName_ ),
170  valueColumnName( valueColumnName_ ),
171  pivotedColumns( pivotedColumns_ ),
172  encoding( "binary" ),
173  options( options_ )
174  {
175  }
176 
300  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_):
301  tableName( tableName_ ),
302  columnNames( columnNames_ ),
303  variableColumnName( variableColumnName_ ),
304  valueColumnName( valueColumnName_ ),
305  pivotedColumns( pivotedColumns_ ),
306  encoding( encoding_ ),
307  options( options_ )
308  {
309  }
310 
311  std::string tableName;
312  std::vector<std::string> columnNames;
313  std::string variableColumnName;
314  std::string valueColumnName;
315  std::vector<std::string> pivotedColumns;
316  std::string encoding;
317  std::map<std::string, std::string> options;
318  };
319 }
320 
321 namespace avro
322 {
323  template<> struct codec_traits<gpudb::AggregateUnpivotRequest>
324  {
325  static void encode(Encoder& e, const gpudb::AggregateUnpivotRequest& v)
326  {
327  ::avro::encode(e, v.tableName);
328  ::avro::encode(e, v.columnNames);
329  ::avro::encode(e, v.variableColumnName);
330  ::avro::encode(e, v.valueColumnName);
331  ::avro::encode(e, v.pivotedColumns);
332  ::avro::encode(e, v.encoding);
333  ::avro::encode(e, v.options);
334  }
335 
336  static void decode(Decoder& d, gpudb::AggregateUnpivotRequest& v)
337  {
338  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
339  {
340  const std::vector<size_t> fo = rd->fieldOrder();
341 
342  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
343  {
344  switch (*it)
345  {
346  case 0:
347  ::avro::decode(d, v.tableName);
348  break;
349 
350  case 1:
351  ::avro::decode(d, v.columnNames);
352  break;
353 
354  case 2:
355  ::avro::decode(d, v.variableColumnName);
356  break;
357 
358  case 3:
359  ::avro::decode(d, v.valueColumnName);
360  break;
361 
362  case 4:
363  ::avro::decode(d, v.pivotedColumns);
364  break;
365 
366  case 5:
367  ::avro::decode(d, v.encoding);
368  break;
369 
370  case 6:
371  ::avro::decode(d, v.options);
372  break;
373 
374  default:
375  break;
376  }
377  }
378  }
379  else
380  {
381  ::avro::decode(d, v.tableName);
382  ::avro::decode(d, v.columnNames);
383  ::avro::decode(d, v.variableColumnName);
384  ::avro::decode(d, v.valueColumnName);
385  ::avro::decode(d, v.pivotedColumns);
386  ::avro::decode(d, v.encoding);
387  ::avro::decode(d, v.options);
388  }
389  }
390  };
391 }
392 
393 namespace gpudb
394 {
395 
419  {
420 
426  tableName(std::string()),
427  responseSchemaStr(std::string()),
428  binaryEncodedResponse(std::vector<uint8_t>()),
429  jsonEncodedResponse(std::string()),
430  totalNumberOfRecords(int64_t()),
431  hasMoreRecords(bool()),
432  info(std::map<std::string, std::string>())
433  {
434  }
435 
436  std::string tableName;
437  std::string responseSchemaStr;
438  std::vector<uint8_t> binaryEncodedResponse;
439  std::string jsonEncodedResponse;
442  std::map<std::string, std::string> info;
443  };
444 }
445 
446 namespace avro
447 {
448  template<> struct codec_traits<gpudb::RawAggregateUnpivotResponse>
449  {
450  static void encode(Encoder& e, const gpudb::RawAggregateUnpivotResponse& v)
451  {
452  ::avro::encode(e, v.tableName);
453  ::avro::encode(e, v.responseSchemaStr);
454  ::avro::encode(e, v.binaryEncodedResponse);
455  ::avro::encode(e, v.jsonEncodedResponse);
456  ::avro::encode(e, v.totalNumberOfRecords);
457  ::avro::encode(e, v.hasMoreRecords);
458  ::avro::encode(e, v.info);
459  }
460 
461  static void decode(Decoder& d, gpudb::RawAggregateUnpivotResponse& v)
462  {
463  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
464  {
465  const std::vector<size_t> fo = rd->fieldOrder();
466 
467  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
468  {
469  switch (*it)
470  {
471  case 0:
472  ::avro::decode(d, v.tableName);
473  break;
474 
475  case 1:
476  ::avro::decode(d, v.responseSchemaStr);
477  break;
478 
479  case 2:
480  ::avro::decode(d, v.binaryEncodedResponse);
481  break;
482 
483  case 3:
484  ::avro::decode(d, v.jsonEncodedResponse);
485  break;
486 
487  case 4:
488  ::avro::decode(d, v.totalNumberOfRecords);
489  break;
490 
491  case 5:
492  ::avro::decode(d, v.hasMoreRecords);
493  break;
494 
495  case 6:
496  ::avro::decode(d, v.info);
497  break;
498 
499  default:
500  break;
501  }
502  }
503  }
504  else
505  {
506  ::avro::decode(d, v.tableName);
507  ::avro::decode(d, v.responseSchemaStr);
508  ::avro::decode(d, v.binaryEncodedResponse);
509  ::avro::decode(d, v.jsonEncodedResponse);
510  ::avro::decode(d, v.totalNumberOfRecords);
511  ::avro::decode(d, v.hasMoreRecords);
512  ::avro::decode(d, v.info);
513  }
514  }
515  };
516 }
517 
518 namespace gpudb
519 {
520 
544  {
545 
551  tableName(std::string()),
552  responseSchemaStr(std::string()),
553  data(std::vector<gpudb::GenericRecord>()),
554  totalNumberOfRecords(int64_t()),
555  hasMoreRecords(bool()),
556  info(std::map<std::string, std::string>()),
557  dataTypePtr((gpudb::Type*)NULL)
558  {
559  }
560 
561  std::string tableName;
562  std::string responseSchemaStr;
563  std::vector<gpudb::GenericRecord> data;
566  std::map<std::string, std::string> info;
568  };
569 }
570 
571 #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