GPUdb C++ API  Version 7.2.2.4
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 
81  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_):
82  tableName( tableName_ ),
83  columnName( columnName_ ),
84  start( start_ ),
85  end( end_ ),
86  interval( interval_ ),
87  options( options_ )
88  {
89  }
90 
97  std::string tableName;
98 
103  std::string columnName;
104 
108  double start;
109 
113  double end;
114 
118  double interval;
119 
131  std::map<std::string, std::string> options;
132  };
133 } // end namespace gpudb
134 
135 namespace avro
136 {
137  template<> struct codec_traits<gpudb::AggregateHistogramRequest>
138  {
139  static void encode(Encoder& e, const gpudb::AggregateHistogramRequest& v)
140  {
141  ::avro::encode(e, v.tableName);
142  ::avro::encode(e, v.columnName);
143  ::avro::encode(e, v.start);
144  ::avro::encode(e, v.end);
145  ::avro::encode(e, v.interval);
146  ::avro::encode(e, v.options);
147  }
148 
149  static void decode(Decoder& d, gpudb::AggregateHistogramRequest& v)
150  {
151  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
152  {
153  const std::vector<size_t> fo = rd->fieldOrder();
154 
155  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
156  {
157  switch (*it)
158  {
159  case 0:
160  ::avro::decode(d, v.tableName);
161  break;
162 
163  case 1:
164  ::avro::decode(d, v.columnName);
165  break;
166 
167  case 2:
168  ::avro::decode(d, v.start);
169  break;
170 
171  case 3:
172  ::avro::decode(d, v.end);
173  break;
174 
175  case 4:
176  ::avro::decode(d, v.interval);
177  break;
178 
179  case 5:
180  ::avro::decode(d, v.options);
181  break;
182 
183  default:
184  break;
185  }
186  }
187  }
188  else
189  {
190  ::avro::decode(d, v.tableName);
191  ::avro::decode(d, v.columnName);
192  ::avro::decode(d, v.start);
193  ::avro::decode(d, v.end);
194  ::avro::decode(d, v.interval);
195  ::avro::decode(d, v.options);
196  }
197  }
198  };
199 } // end namespace avro
200 
201 namespace gpudb
202 {
209  {
215  counts(std::vector<double>()),
216  start(double()),
217  end(double()),
218  info(std::map<std::string, std::string>())
219  {
220  }
221 
226  std::vector<double> counts;
227 
231  double start;
232 
236  double end;
237 
241  std::map<std::string, std::string> info;
242  };
243 } // end namespace gpudb
244 
245 namespace avro
246 {
247  template<> struct codec_traits<gpudb::AggregateHistogramResponse>
248  {
249  static void encode(Encoder& e, const gpudb::AggregateHistogramResponse& v)
250  {
251  ::avro::encode(e, v.counts);
252  ::avro::encode(e, v.start);
253  ::avro::encode(e, v.end);
254  ::avro::encode(e, v.info);
255  }
256 
257  static void decode(Decoder& d, gpudb::AggregateHistogramResponse& v)
258  {
259  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
260  {
261  const std::vector<size_t> fo = rd->fieldOrder();
262 
263  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
264  {
265  switch (*it)
266  {
267  case 0:
268  ::avro::decode(d, v.counts);
269  break;
270 
271  case 1:
272  ::avro::decode(d, v.start);
273  break;
274 
275  case 2:
276  ::avro::decode(d, v.end);
277  break;
278 
279  case 3:
280  ::avro::decode(d, v.info);
281  break;
282 
283  default:
284  break;
285  }
286  }
287  }
288  else
289  {
290  ::avro::decode(d, v.counts);
291  ::avro::decode(d, v.start);
292  ::avro::decode(d, v.end);
293  ::avro::decode(d, v.info);
294  }
295  }
296  };
297 } // end namespace avro
298 
299 #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.