GPUdb C++ API  Version 6.2.0.3
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 
158  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_):
159  tableName( tableName_ ),
160  columnNames( columnNames_ ),
161  variableColumnName( variableColumnName_ ),
162  valueColumnName( valueColumnName_ ),
163  pivotedColumns( pivotedColumns_ ),
164  encoding( "binary" ),
165  options( options_ )
166  {
167  }
168 
284  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_):
285  tableName( tableName_ ),
286  columnNames( columnNames_ ),
287  variableColumnName( variableColumnName_ ),
288  valueColumnName( valueColumnName_ ),
289  pivotedColumns( pivotedColumns_ ),
290  encoding( encoding_ ),
291  options( options_ )
292  {
293  }
294 
295  std::string tableName;
296  std::vector<std::string> columnNames;
297  std::string variableColumnName;
298  std::string valueColumnName;
299  std::vector<std::string> pivotedColumns;
300  std::string encoding;
301  std::map<std::string, std::string> options;
302  };
303 }
304 
305 namespace avro
306 {
307  template<> struct codec_traits<gpudb::AggregateUnpivotRequest>
308  {
309  static void encode(Encoder& e, const gpudb::AggregateUnpivotRequest& v)
310  {
311  ::avro::encode(e, v.tableName);
312  ::avro::encode(e, v.columnNames);
313  ::avro::encode(e, v.variableColumnName);
314  ::avro::encode(e, v.valueColumnName);
315  ::avro::encode(e, v.pivotedColumns);
316  ::avro::encode(e, v.encoding);
317  ::avro::encode(e, v.options);
318  }
319 
320  static void decode(Decoder& d, gpudb::AggregateUnpivotRequest& v)
321  {
322  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
323  {
324  const std::vector<size_t> fo = rd->fieldOrder();
325 
326  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
327  {
328  switch (*it)
329  {
330  case 0:
331  ::avro::decode(d, v.tableName);
332  break;
333 
334  case 1:
335  ::avro::decode(d, v.columnNames);
336  break;
337 
338  case 2:
339  ::avro::decode(d, v.variableColumnName);
340  break;
341 
342  case 3:
343  ::avro::decode(d, v.valueColumnName);
344  break;
345 
346  case 4:
347  ::avro::decode(d, v.pivotedColumns);
348  break;
349 
350  case 5:
351  ::avro::decode(d, v.encoding);
352  break;
353 
354  case 6:
355  ::avro::decode(d, v.options);
356  break;
357 
358  default:
359  break;
360  }
361  }
362  }
363  else
364  {
365  ::avro::decode(d, v.tableName);
366  ::avro::decode(d, v.columnNames);
367  ::avro::decode(d, v.variableColumnName);
368  ::avro::decode(d, v.valueColumnName);
369  ::avro::decode(d, v.pivotedColumns);
370  ::avro::decode(d, v.encoding);
371  ::avro::decode(d, v.options);
372  }
373  }
374  };
375 }
376 
377 namespace gpudb
378 {
379 
403  {
404 
410  tableName(std::string()),
411  responseSchemaStr(std::string()),
412  binaryEncodedResponse(std::vector<uint8_t>()),
413  jsonEncodedResponse(std::string()),
414  totalNumberOfRecords(int64_t()),
415  hasMoreRecords(bool())
416  {
417  }
418 
419  std::string tableName;
420  std::string responseSchemaStr;
421  std::vector<uint8_t> binaryEncodedResponse;
422  std::string jsonEncodedResponse;
425  };
426 }
427 
428 namespace avro
429 {
430  template<> struct codec_traits<gpudb::RawAggregateUnpivotResponse>
431  {
432  static void encode(Encoder& e, const gpudb::RawAggregateUnpivotResponse& v)
433  {
434  ::avro::encode(e, v.tableName);
435  ::avro::encode(e, v.responseSchemaStr);
436  ::avro::encode(e, v.binaryEncodedResponse);
437  ::avro::encode(e, v.jsonEncodedResponse);
438  ::avro::encode(e, v.totalNumberOfRecords);
439  ::avro::encode(e, v.hasMoreRecords);
440  }
441 
442  static void decode(Decoder& d, gpudb::RawAggregateUnpivotResponse& v)
443  {
444  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
445  {
446  const std::vector<size_t> fo = rd->fieldOrder();
447 
448  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
449  {
450  switch (*it)
451  {
452  case 0:
453  ::avro::decode(d, v.tableName);
454  break;
455 
456  case 1:
457  ::avro::decode(d, v.responseSchemaStr);
458  break;
459 
460  case 2:
461  ::avro::decode(d, v.binaryEncodedResponse);
462  break;
463 
464  case 3:
465  ::avro::decode(d, v.jsonEncodedResponse);
466  break;
467 
468  case 4:
469  ::avro::decode(d, v.totalNumberOfRecords);
470  break;
471 
472  case 5:
473  ::avro::decode(d, v.hasMoreRecords);
474  break;
475 
476  default:
477  break;
478  }
479  }
480  }
481  else
482  {
483  ::avro::decode(d, v.tableName);
484  ::avro::decode(d, v.responseSchemaStr);
485  ::avro::decode(d, v.binaryEncodedResponse);
486  ::avro::decode(d, v.jsonEncodedResponse);
487  ::avro::decode(d, v.totalNumberOfRecords);
488  ::avro::decode(d, v.hasMoreRecords);
489  }
490  }
491  };
492 }
493 
494 namespace gpudb
495 {
496 
520  {
521 
527  tableName(std::string()),
528  responseSchemaStr(std::string()),
529  data(std::vector<gpudb::GenericRecord>()),
530  totalNumberOfRecords(int64_t()),
531  hasMoreRecords(bool()),
532  dataTypePtr((gpudb::Type*)NULL)
533  {
534  }
535 
536  std::string tableName;
537  std::string responseSchemaStr;
538  std::vector<gpudb::GenericRecord> data;
542  };
543 }
544 
545 #endif
boost::shared_ptr< Type > gpudb_type_ptr_t
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 aggregateUnpivot(const AggregateUnpivotRequest&) const.
RawAggregateUnpivotResponse()
Constructs a RawAggregateUnpivotResponse object with default parameter values.
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 aggregateUnpivotRaw(const AggregateUnpivotRequest&) 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 aggregateUnpivotRaw(const AggregateUnpivotRequest&) const...
std::vector< std::string > pivotedColumns