GPUdb C++ API  Version 5.2.0.0
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 
41  {
42 
48  tableName(std::string()),
49  columnNames(std::vector<std::string>()),
50  offset(int64_t()),
51  limit(int64_t()),
52  encoding(std::string("binary")),
53  options(std::map<std::string, std::string>())
54  {
55  }
56 
97  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):
98  tableName(tableName),
99  columnNames(columnNames),
100  offset(offset),
101  limit(limit),
102  encoding("binary"),
103  options(options)
104  {
105  }
106 
150  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):
151  tableName(tableName),
152  columnNames(columnNames),
153  offset(offset),
154  limit(limit),
155  encoding(encoding),
156  options(options)
157  {
158  }
159 
160  std::string tableName;
161  std::vector<std::string> columnNames;
162  int64_t offset;
163  int64_t limit;
164  std::string encoding;
165  std::map<std::string, std::string> options;
166  };
167 }
168 
169 namespace avro
170 {
171  template<> struct codec_traits<gpudb::AggregateGroupByRequest>
172  {
173  static void encode(Encoder& e, const gpudb::AggregateGroupByRequest& v)
174  {
175  ::avro::encode(e, v.tableName);
176  ::avro::encode(e, v.columnNames);
177  ::avro::encode(e, v.offset);
178  ::avro::encode(e, v.limit);
179  ::avro::encode(e, v.encoding);
180  ::avro::encode(e, v.options);
181  }
182 
183  static void decode(Decoder& d, gpudb::AggregateGroupByRequest& v)
184  {
185  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
186  {
187  const std::vector<size_t> fo = rd->fieldOrder();
188 
189  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
190  {
191  switch (*it)
192  {
193  case 0:
194  ::avro::decode(d, v.tableName);
195  break;
196 
197  case 1:
198  ::avro::decode(d, v.columnNames);
199  break;
200 
201  case 2:
202  ::avro::decode(d, v.offset);
203  break;
204 
205  case 3:
206  ::avro::decode(d, v.limit);
207  break;
208 
209  case 4:
210  ::avro::decode(d, v.encoding);
211  break;
212 
213  case 5:
214  ::avro::decode(d, v.options);
215  break;
216 
217  default:
218  break;
219  }
220  }
221  }
222  else
223  {
224  ::avro::decode(d, v.tableName);
225  ::avro::decode(d, v.columnNames);
226  ::avro::decode(d, v.offset);
227  ::avro::decode(d, v.limit);
228  ::avro::decode(d, v.encoding);
229  ::avro::decode(d, v.options);
230  }
231  }
232  };
233 }
234 
235 namespace gpudb
236 {
237 
265  {
266 
272  responseSchemaStr(std::string()),
273  binaryEncodedResponse(std::vector<uint8_t>()),
274  jsonEncodedResponse(std::string()),
275  totalNumberOfRecords(int64_t()),
276  hasMoreRecords(bool())
277  {
278  }
279 
280  std::string responseSchemaStr;
281  std::vector<uint8_t> binaryEncodedResponse;
282  std::string jsonEncodedResponse;
285  };
286 }
287 
288 namespace avro
289 {
290  template<> struct codec_traits<gpudb::RawAggregateGroupByResponse>
291  {
292  static void encode(Encoder& e, const gpudb::RawAggregateGroupByResponse& v)
293  {
294  ::avro::encode(e, v.responseSchemaStr);
295  ::avro::encode(e, v.binaryEncodedResponse);
296  ::avro::encode(e, v.jsonEncodedResponse);
297  ::avro::encode(e, v.totalNumberOfRecords);
298  ::avro::encode(e, v.hasMoreRecords);
299  }
300 
301  static void decode(Decoder& d, gpudb::RawAggregateGroupByResponse& v)
302  {
303  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
304  {
305  const std::vector<size_t> fo = rd->fieldOrder();
306 
307  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
308  {
309  switch (*it)
310  {
311  case 0:
312  ::avro::decode(d, v.responseSchemaStr);
313  break;
314 
315  case 1:
316  ::avro::decode(d, v.binaryEncodedResponse);
317  break;
318 
319  case 2:
320  ::avro::decode(d, v.jsonEncodedResponse);
321  break;
322 
323  case 3:
324  ::avro::decode(d, v.totalNumberOfRecords);
325  break;
326 
327  case 4:
328  ::avro::decode(d, v.hasMoreRecords);
329  break;
330 
331  default:
332  break;
333  }
334  }
335  }
336  else
337  {
338  ::avro::decode(d, v.responseSchemaStr);
339  ::avro::decode(d, v.binaryEncodedResponse);
340  ::avro::decode(d, v.jsonEncodedResponse);
341  ::avro::decode(d, v.totalNumberOfRecords);
342  ::avro::decode(d, v.hasMoreRecords);
343  }
344  }
345  };
346 }
347 
348 namespace gpudb
349 {
350 
378  {
379 
385  responseSchemaStr(std::string()),
386  data(std::vector<gpudb::GenericRecord>()),
387  totalNumberOfRecords(int64_t()),
388  hasMoreRecords(bool())
389  {
390  }
391 
392  std::string responseSchemaStr;
393  std::vector<gpudb::GenericRecord> data;
396  };
397 }
398 
399 #endif
A set of output parameters for aggregateGroupByRaw(const AggregateGroupByRequest&) 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 aggregateGroupByRaw(const AggregateGroupByRequest&) const...
AggregateGroupByResponse()
Constructs an AggregateGroupByResponse object with default parameter values.
std::vector< std::string > columnNames
std::vector< uint8_t > binaryEncodedResponse
AggregateGroupByRequest()
Constructs an AggregateGroupByRequest object with default parameter values.
A set of output parameters for aggregateGroupBy(const AggregateGroupByRequest&) const.
RawAggregateGroupByResponse()
Constructs a RawAggregateGroupByResponse object with default parameter values.
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::map< std::string, std::string > options
std::vector< gpudb::GenericRecord > data