GPUdb C++ API  Version 7.2.3.0
aggregate_histogram.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __AGGREGATE_HISTOGRAM_H__
7 #define __AGGREGATE_HISTOGRAM_H__
8 
9 namespace gpudb
10 {
34  {
40  tableName(std::string()),
41  columnName(std::string()),
42  start(double()),
43  end(double()),
44  interval(double()),
45  options(std::map<std::string, std::string>())
46  {
47  }
48 
91  AggregateHistogramRequest(const std::string& tableName_, const std::string& columnName_, const double start_, const double end_, const double interval_, const std::map<std::string, std::string>& options_):
92  tableName( tableName_ ),
93  columnName( columnName_ ),
94  start( start_ ),
95  end( end_ ),
96  interval( interval_ ),
97  options( options_ )
98  {
99  }
100 
107  std::string tableName;
108 
113  std::string columnName;
114 
118  double start;
119 
123  double end;
124 
128  double interval;
129 
149  std::map<std::string, std::string> options;
150  };
151 } // end namespace gpudb
152 
153 namespace avro
154 {
155  template<> struct codec_traits<gpudb::AggregateHistogramRequest>
156  {
157  static void encode(Encoder& e, const gpudb::AggregateHistogramRequest& v)
158  {
159  ::avro::encode(e, v.tableName);
160  ::avro::encode(e, v.columnName);
161  ::avro::encode(e, v.start);
162  ::avro::encode(e, v.end);
163  ::avro::encode(e, v.interval);
164  ::avro::encode(e, v.options);
165  }
166 
167  static void decode(Decoder& d, gpudb::AggregateHistogramRequest& v)
168  {
169  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
170  {
171  const std::vector<size_t> fo = rd->fieldOrder();
172 
173  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
174  {
175  switch (*it)
176  {
177  case 0:
178  ::avro::decode(d, v.tableName);
179  break;
180 
181  case 1:
182  ::avro::decode(d, v.columnName);
183  break;
184 
185  case 2:
186  ::avro::decode(d, v.start);
187  break;
188 
189  case 3:
190  ::avro::decode(d, v.end);
191  break;
192 
193  case 4:
194  ::avro::decode(d, v.interval);
195  break;
196 
197  case 5:
198  ::avro::decode(d, v.options);
199  break;
200 
201  default:
202  break;
203  }
204  }
205  }
206  else
207  {
208  ::avro::decode(d, v.tableName);
209  ::avro::decode(d, v.columnName);
210  ::avro::decode(d, v.start);
211  ::avro::decode(d, v.end);
212  ::avro::decode(d, v.interval);
213  ::avro::decode(d, v.options);
214  }
215  }
216  };
217 } // end namespace avro
218 
219 namespace gpudb
220 {
227  {
233  counts(std::vector<double>()),
234  start(double()),
235  end(double()),
236  info(std::map<std::string, std::string>())
237  {
238  }
239 
244  std::vector<double> counts;
245 
249  double start;
250 
254  double end;
255 
259  std::map<std::string, std::string> info;
260  };
261 } // end namespace gpudb
262 
263 namespace avro
264 {
265  template<> struct codec_traits<gpudb::AggregateHistogramResponse>
266  {
267  static void encode(Encoder& e, const gpudb::AggregateHistogramResponse& v)
268  {
269  ::avro::encode(e, v.counts);
270  ::avro::encode(e, v.start);
271  ::avro::encode(e, v.end);
272  ::avro::encode(e, v.info);
273  }
274 
275  static void decode(Decoder& d, gpudb::AggregateHistogramResponse& v)
276  {
277  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
278  {
279  const std::vector<size_t> fo = rd->fieldOrder();
280 
281  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
282  {
283  switch (*it)
284  {
285  case 0:
286  ::avro::decode(d, v.counts);
287  break;
288 
289  case 1:
290  ::avro::decode(d, v.start);
291  break;
292 
293  case 2:
294  ::avro::decode(d, v.end);
295  break;
296 
297  case 3:
298  ::avro::decode(d, v.info);
299  break;
300 
301  default:
302  break;
303  }
304  }
305  }
306  else
307  {
308  ::avro::decode(d, v.counts);
309  ::avro::decode(d, v.start);
310  ::avro::decode(d, v.end);
311  ::avro::decode(d, v.info);
312  }
313  }
314  };
315 } // end namespace avro
316 
317 #endif // __AGGREGATE_HISTOGRAM_H__
std::string columnName
Name of a column or an expression of one or more column names over which the histogram will be calcul...
std::string tableName
Name of the table on which the operation will be performed.
AggregateHistogramRequest()
Constructs an AggregateHistogramRequest object with default parameters.
std::map< std::string, std::string > options
Optional parameters.
AggregateHistogramRequest(const std::string &tableName_, const std::string &columnName_, const double start_, const double end_, const double interval_, const std::map< std::string, std::string > &options_)
Constructs an AggregateHistogramRequest object with the specified parameters.
AggregateHistogramResponse()
Constructs an AggregateHistogramResponse object with default parameters.
double interval
The size of each bin within the start and end parameters.
double start
Lower end value of the histogram interval, inclusive.
A set of results returned by GPUdb::aggregateHistogram.
A set of parameters for GPUdb::aggregateHistogram.
std::vector< double > counts
The array of calculated values that represents the histogram data points.
std::map< std::string, std::string > info
Additional information.
double end
Upper end value of the histogram interval, inclusive.