GPUdb C++ API  Version 7.2.2.4
merge_records.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 __MERGE_RECORDS_H__
7 #define __MERGE_RECORDS_H__
8 
9 namespace gpudb
10 {
34  {
39  tableName(std::string()),
40  sourceTableNames(std::vector<std::string>()),
41  fieldMaps(std::vector<std::map<std::string, std::string> >()),
42  options(std::map<std::string, std::string>())
43  {
44  }
45 
195  MergeRecordsRequest(const std::string& tableName_, const std::vector<std::string>& sourceTableNames_, const std::vector<std::map<std::string, std::string> >& fieldMaps_, const std::map<std::string, std::string>& options_):
196  tableName( tableName_ ),
197  sourceTableNames( sourceTableNames_ ),
198  fieldMaps( fieldMaps_ ),
199  options( options_ )
200  {
201  }
202 
212  std::string tableName;
213 
221  std::vector<std::string> sourceTableNames;
222 
234  std::vector<std::map<std::string, std::string> > fieldMaps;
235 
320  std::map<std::string, std::string> options;
321  };
322 } // end namespace gpudb
323 
324 namespace avro
325 {
326  template<> struct codec_traits<gpudb::MergeRecordsRequest>
327  {
328  static void encode(Encoder& e, const gpudb::MergeRecordsRequest& v)
329  {
330  ::avro::encode(e, v.tableName);
331  ::avro::encode(e, v.sourceTableNames);
332  ::avro::encode(e, v.fieldMaps);
333  ::avro::encode(e, v.options);
334  }
335 
336  static void decode(Decoder& d, gpudb::MergeRecordsRequest& v)
337  {
338  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
339  {
340  const std::vector<size_t> fo = rd->fieldOrder();
341 
342  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
343  {
344  switch (*it)
345  {
346  case 0:
347  ::avro::decode(d, v.tableName);
348  break;
349 
350  case 1:
351  ::avro::decode(d, v.sourceTableNames);
352  break;
353 
354  case 2:
355  ::avro::decode(d, v.fieldMaps);
356  break;
357 
358  case 3:
359  ::avro::decode(d, v.options);
360  break;
361 
362  default:
363  break;
364  }
365  }
366  }
367  else
368  {
369  ::avro::decode(d, v.tableName);
370  ::avro::decode(d, v.sourceTableNames);
371  ::avro::decode(d, v.fieldMaps);
372  ::avro::decode(d, v.options);
373  }
374  }
375  };
376 } // end namespace avro
377 
378 namespace gpudb
379 {
386  {
391  tableName(std::string()),
392  info(std::map<std::string, std::string>())
393  {
394  }
395 
396  std::string tableName;
397 
407  std::map<std::string, std::string> info;
408  };
409 } // end namespace gpudb
410 
411 namespace avro
412 {
413  template<> struct codec_traits<gpudb::MergeRecordsResponse>
414  {
415  static void encode(Encoder& e, const gpudb::MergeRecordsResponse& v)
416  {
417  ::avro::encode(e, v.tableName);
418  ::avro::encode(e, v.info);
419  }
420 
421  static void decode(Decoder& d, gpudb::MergeRecordsResponse& v)
422  {
423  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
424  {
425  const std::vector<size_t> fo = rd->fieldOrder();
426 
427  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
428  {
429  switch (*it)
430  {
431  case 0:
432  ::avro::decode(d, v.tableName);
433  break;
434 
435  case 1:
436  ::avro::decode(d, v.info);
437  break;
438 
439  default:
440  break;
441  }
442  }
443  }
444  else
445  {
446  ::avro::decode(d, v.tableName);
447  ::avro::decode(d, v.info);
448  }
449  }
450  };
451 } // end namespace avro
452 
453 #endif // __MERGE_RECORDS_H__
MergeRecordsRequest(const std::string &tableName_, const std::vector< std::string > &sourceTableNames_, const std::vector< std::map< std::string, std::string > > &fieldMaps_, const std::map< std::string, std::string > &options_)
Constructs a MergeRecordsRequest object with the specified parameters.
std::map< std::string, std::string > options
Optional parameters.
MergeRecordsRequest()
Constructs a MergeRecordsRequest object with default parameters.
Definition: merge_records.h:38
A set of results returned by GPUdb::mergeRecords.
std::vector< std::string > sourceTableNames
The list of names of source tables to get the records from, each in [ schema_name....
A set of parameters for GPUdb::mergeRecords.
Definition: merge_records.h:33
std::string tableName
The name of the new result table for the records to be merged into, in [ schema_name....
std::vector< std::map< std::string, std::string > > fieldMaps
Contains a list of source/target column mappings, one mapping for each source table listed in sourceT...
std::map< std::string, std::string > info
Additional information.
MergeRecordsResponse()
Constructs a MergeRecordsResponse object with default parameters.