GPUdb C++ API  Version 5.2.0.0
aggregate_statistics.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_STATISTICS_H__
7 #define __AGGREGATE_STATISTICS_H__
8 
9 namespace gpudb
10 {
11 
41  {
42 
48  tableName(std::string()),
49  columnName(std::string()),
50  stats(std::string()),
51  options(std::map<std::string, std::string>())
52  {
53  }
54 
82  AggregateStatisticsRequest(const std::string& tableName, const std::string& columnName, const std::string& stats, const std::map<std::string, std::string>& options):
83  tableName(tableName),
84  columnName(columnName),
85  stats(stats),
86  options(options)
87  {
88  }
89 
90  std::string tableName;
91  std::string columnName;
92  std::string stats;
93  std::map<std::string, std::string> options;
94  };
95 }
96 
97 namespace avro
98 {
99  template<> struct codec_traits<gpudb::AggregateStatisticsRequest>
100  {
101  static void encode(Encoder& e, const gpudb::AggregateStatisticsRequest& v)
102  {
103  ::avro::encode(e, v.tableName);
104  ::avro::encode(e, v.columnName);
105  ::avro::encode(e, v.stats);
106  ::avro::encode(e, v.options);
107  }
108 
109  static void decode(Decoder& d, gpudb::AggregateStatisticsRequest& v)
110  {
111  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
112  {
113  const std::vector<size_t> fo = rd->fieldOrder();
114 
115  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
116  {
117  switch (*it)
118  {
119  case 0:
120  ::avro::decode(d, v.tableName);
121  break;
122 
123  case 1:
124  ::avro::decode(d, v.columnName);
125  break;
126 
127  case 2:
128  ::avro::decode(d, v.stats);
129  break;
130 
131  case 3:
132  ::avro::decode(d, v.options);
133  break;
134 
135  default:
136  break;
137  }
138  }
139  }
140  else
141  {
142  ::avro::decode(d, v.tableName);
143  ::avro::decode(d, v.columnName);
144  ::avro::decode(d, v.stats);
145  ::avro::decode(d, v.options);
146  }
147  }
148  };
149 }
150 
151 namespace gpudb
152 {
153 
183  {
184 
190  stats(std::map<std::string, double>())
191  {
192  }
193 
194  std::map<std::string, double> stats;
195  };
196 }
197 
198 namespace avro
199 {
200  template<> struct codec_traits<gpudb::AggregateStatisticsResponse>
201  {
202  static void encode(Encoder& e, const gpudb::AggregateStatisticsResponse& v)
203  {
204  ::avro::encode(e, v.stats);
205  }
206 
207  static void decode(Decoder& d, gpudb::AggregateStatisticsResponse& v)
208  {
209  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
210  {
211  const std::vector<size_t> fo = rd->fieldOrder();
212 
213  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
214  {
215  switch (*it)
216  {
217  case 0:
218  ::avro::decode(d, v.stats);
219  break;
220 
221  default:
222  break;
223  }
224  }
225  }
226  else
227  {
228  ::avro::decode(d, v.stats);
229  }
230  }
231  };
232 }
233 
234 #endif
AggregateStatisticsRequest()
Constructs an AggregateStatisticsRequest object with default parameter values.
A set of input parameters for aggregateStatistics(const AggregateStatisticsRequest&) const...
A set of output parameters for aggregateStatistics(const AggregateStatisticsRequest&) const...
std::map< std::string, double > stats
AggregateStatisticsResponse()
Constructs an AggregateStatisticsResponse object with default parameter values.
std::map< std::string, std::string > options
AggregateStatisticsRequest(const std::string &tableName, const std::string &columnName, const std::string &stats, const std::map< std::string, std::string > &options)
Constructs an AggregateStatisticsRequest object with the specified parameters.