GPUdb C++ API  Version 6.1.0.0
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 
33  {
34 
40  tableName(std::string()),
41  variableColumnName(std::string()),
42  valueColumnName(std::string()),
43  pivotedColumns(std::vector<std::string>()),
44  encoding(std::string("binary")),
45  options(std::map<std::string, std::string>())
46  {
47  }
48 
117  AggregateUnpivotRequest(const std::string& tableName_, const std::string& variableColumnName_, const std::string& valueColumnName_, const std::vector<std::string>& pivotedColumns_, const std::map<std::string, std::string>& options_):
118  tableName( tableName_ ),
119  variableColumnName( variableColumnName_ ),
120  valueColumnName( valueColumnName_ ),
121  pivotedColumns( pivotedColumns_ ),
122  encoding( "binary" ),
123  options( options_ )
124  {
125  }
126 
206  AggregateUnpivotRequest(const std::string& tableName_, 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_):
207  tableName( tableName_ ),
208  variableColumnName( variableColumnName_ ),
209  valueColumnName( valueColumnName_ ),
210  pivotedColumns( pivotedColumns_ ),
211  encoding( encoding_ ),
212  options( options_ )
213  {
214  }
215 
216  std::string tableName;
217  std::string variableColumnName;
218  std::string valueColumnName;
219  std::vector<std::string> pivotedColumns;
220  std::string encoding;
221  std::map<std::string, std::string> options;
222  };
223 }
224 
225 namespace avro
226 {
227  template<> struct codec_traits<gpudb::AggregateUnpivotRequest>
228  {
229  static void encode(Encoder& e, const gpudb::AggregateUnpivotRequest& v)
230  {
231  ::avro::encode(e, v.tableName);
232  ::avro::encode(e, v.variableColumnName);
233  ::avro::encode(e, v.valueColumnName);
234  ::avro::encode(e, v.pivotedColumns);
235  ::avro::encode(e, v.encoding);
236  ::avro::encode(e, v.options);
237  }
238 
239  static void decode(Decoder& d, gpudb::AggregateUnpivotRequest& v)
240  {
241  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
242  {
243  const std::vector<size_t> fo = rd->fieldOrder();
244 
245  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
246  {
247  switch (*it)
248  {
249  case 0:
250  ::avro::decode(d, v.tableName);
251  break;
252 
253  case 1:
254  ::avro::decode(d, v.variableColumnName);
255  break;
256 
257  case 2:
258  ::avro::decode(d, v.valueColumnName);
259  break;
260 
261  case 3:
262  ::avro::decode(d, v.pivotedColumns);
263  break;
264 
265  case 4:
266  ::avro::decode(d, v.encoding);
267  break;
268 
269  case 5:
270  ::avro::decode(d, v.options);
271  break;
272 
273  default:
274  break;
275  }
276  }
277  }
278  else
279  {
280  ::avro::decode(d, v.tableName);
281  ::avro::decode(d, v.variableColumnName);
282  ::avro::decode(d, v.valueColumnName);
283  ::avro::decode(d, v.pivotedColumns);
284  ::avro::decode(d, v.encoding);
285  ::avro::decode(d, v.options);
286  }
287  }
288  };
289 }
290 
291 namespace gpudb
292 {
293 
313  {
314 
320  tableName(std::string()),
321  responseSchemaStr(std::string()),
322  binaryEncodedResponse(std::vector<uint8_t>()),
323  jsonEncodedResponse(std::string()),
324  totalNumberOfRecords(int64_t()),
325  hasMoreRecords(bool())
326  {
327  }
328 
329  std::string tableName;
330  std::string responseSchemaStr;
331  std::vector<uint8_t> binaryEncodedResponse;
332  std::string jsonEncodedResponse;
335  };
336 }
337 
338 namespace avro
339 {
340  template<> struct codec_traits<gpudb::RawAggregateUnpivotResponse>
341  {
342  static void encode(Encoder& e, const gpudb::RawAggregateUnpivotResponse& v)
343  {
344  ::avro::encode(e, v.tableName);
345  ::avro::encode(e, v.responseSchemaStr);
346  ::avro::encode(e, v.binaryEncodedResponse);
347  ::avro::encode(e, v.jsonEncodedResponse);
348  ::avro::encode(e, v.totalNumberOfRecords);
349  ::avro::encode(e, v.hasMoreRecords);
350  }
351 
352  static void decode(Decoder& d, gpudb::RawAggregateUnpivotResponse& v)
353  {
354  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
355  {
356  const std::vector<size_t> fo = rd->fieldOrder();
357 
358  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
359  {
360  switch (*it)
361  {
362  case 0:
363  ::avro::decode(d, v.tableName);
364  break;
365 
366  case 1:
367  ::avro::decode(d, v.responseSchemaStr);
368  break;
369 
370  case 2:
371  ::avro::decode(d, v.binaryEncodedResponse);
372  break;
373 
374  case 3:
375  ::avro::decode(d, v.jsonEncodedResponse);
376  break;
377 
378  case 4:
379  ::avro::decode(d, v.totalNumberOfRecords);
380  break;
381 
382  case 5:
383  ::avro::decode(d, v.hasMoreRecords);
384  break;
385 
386  default:
387  break;
388  }
389  }
390  }
391  else
392  {
393  ::avro::decode(d, v.tableName);
394  ::avro::decode(d, v.responseSchemaStr);
395  ::avro::decode(d, v.binaryEncodedResponse);
396  ::avro::decode(d, v.jsonEncodedResponse);
397  ::avro::decode(d, v.totalNumberOfRecords);
398  ::avro::decode(d, v.hasMoreRecords);
399  }
400  }
401  };
402 }
403 
404 namespace gpudb
405 {
406 
426  {
427 
433  tableName(std::string()),
434  responseSchemaStr(std::string()),
435  data(std::vector<gpudb::GenericRecord>()),
436  totalNumberOfRecords(int64_t()),
437  hasMoreRecords(bool())
438  {
439  }
440 
441  std::string tableName;
442  std::string responseSchemaStr;
443  std::vector<gpudb::GenericRecord> data;
446  };
447 }
448 
449 #endif
AggregateUnpivotRequest(const std::string &tableName_, 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.
std::vector< uint8_t > binaryEncodedResponse
A set of output parameters for aggregateUnpivot(const AggregateUnpivotRequest&) const.
RawAggregateUnpivotResponse()
Constructs a RawAggregateUnpivotResponse object with default parameter values.
AggregateUnpivotRequest()
Constructs an AggregateUnpivotRequest object with default parameter values.
A set of output parameters for aggregateUnpivotRaw(const AggregateUnpivotRequest&) const...
std::vector< gpudb::GenericRecord > data
AggregateUnpivotRequest(const std::string &tableName_, 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.
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