GPUdb C++ API  Version 7.2.2.4
get_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 __GET_RECORDS_H__
7 #define __GET_RECORDS_H__
8 
9 namespace gpudb
10 {
27  {
32  tableName(std::string()),
33  offset(int64_t()),
34  limit(int64_t()),
35  encoding(std::string("binary")),
36  options(std::map<std::string, std::string>())
37  {
38  }
39 
120  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
121  tableName( tableName_ ),
122  offset( offset_ ),
123  limit( limit_ ),
124  encoding( "binary" ),
125  options( options_ )
126  {
127  }
128 
227  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
228  tableName( tableName_ ),
229  offset( offset_ ),
230  limit( limit_ ),
231  encoding( encoding_ ),
232  options( options_ )
233  {
234  }
235 
242  std::string tableName;
243 
250  int64_t offset;
251 
264  int64_t limit;
265 
280  std::string encoding;
281 
319  std::map<std::string, std::string> options;
320  };
321 } // end namespace gpudb
322 
323 namespace avro
324 {
325  template<> struct codec_traits<gpudb::GetRecordsRequest>
326  {
327  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
328  {
329  ::avro::encode(e, v.tableName);
330  ::avro::encode(e, v.offset);
331  ::avro::encode(e, v.limit);
332  ::avro::encode(e, v.encoding);
333  ::avro::encode(e, v.options);
334  }
335 
336  static void decode(Decoder& d, gpudb::GetRecordsRequest& 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.offset);
352  break;
353 
354  case 2:
355  ::avro::decode(d, v.limit);
356  break;
357 
358  case 3:
359  ::avro::decode(d, v.encoding);
360  break;
361 
362  case 4:
363  ::avro::decode(d, v.options);
364  break;
365 
366  default:
367  break;
368  }
369  }
370  }
371  else
372  {
373  ::avro::decode(d, v.tableName);
374  ::avro::decode(d, v.offset);
375  ::avro::decode(d, v.limit);
376  ::avro::decode(d, v.encoding);
377  ::avro::decode(d, v.options);
378  }
379  }
380  };
381 } // end namespace avro
382 
383 namespace gpudb
384 {
391  {
396  tableName(std::string()),
397  typeName(std::string()),
398  typeSchema(std::string()),
399  recordsBinary(std::vector<std::vector<uint8_t> >()),
400  recordsJson(std::vector<std::string>()),
401  totalNumberOfRecords(int64_t()),
402  hasMoreRecords(bool()),
403  info(std::map<std::string, std::string>())
404  {
405  }
406 
410  std::string tableName;
411 
412  std::string typeName;
413 
417  std::string typeSchema;
418 
424  std::vector<std::vector<uint8_t> > recordsBinary;
425 
434  std::vector<std::string> recordsJson;
435 
440 
445 
449  std::map<std::string, std::string> info;
450  };
451 } // end namespace gpudb
452 
453 namespace avro
454 {
455  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
456  {
457  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
458  {
459  ::avro::encode(e, v.tableName);
460  ::avro::encode(e, v.typeName);
461  ::avro::encode(e, v.typeSchema);
462  ::avro::encode(e, v.recordsBinary);
463  ::avro::encode(e, v.recordsJson);
464  ::avro::encode(e, v.totalNumberOfRecords);
465  ::avro::encode(e, v.hasMoreRecords);
466  ::avro::encode(e, v.info);
467  }
468 
469  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
470  {
471  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
472  {
473  const std::vector<size_t> fo = rd->fieldOrder();
474 
475  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
476  {
477  switch (*it)
478  {
479  case 0:
480  ::avro::decode(d, v.tableName);
481  break;
482 
483  case 1:
484  ::avro::decode(d, v.typeName);
485  break;
486 
487  case 2:
488  ::avro::decode(d, v.typeSchema);
489  break;
490 
491  case 3:
492  ::avro::decode(d, v.recordsBinary);
493  break;
494 
495  case 4:
496  ::avro::decode(d, v.recordsJson);
497  break;
498 
499  case 5:
500  ::avro::decode(d, v.totalNumberOfRecords);
501  break;
502 
503  case 6:
504  ::avro::decode(d, v.hasMoreRecords);
505  break;
506 
507  case 7:
508  ::avro::decode(d, v.info);
509  break;
510 
511  default:
512  break;
513  }
514  }
515  }
516  else
517  {
518  ::avro::decode(d, v.tableName);
519  ::avro::decode(d, v.typeName);
520  ::avro::decode(d, v.typeSchema);
521  ::avro::decode(d, v.recordsBinary);
522  ::avro::decode(d, v.recordsJson);
523  ::avro::decode(d, v.totalNumberOfRecords);
524  ::avro::decode(d, v.hasMoreRecords);
525  ::avro::decode(d, v.info);
526  }
527  }
528  };
529 } // end namespace avro
530 
531 namespace gpudb
532 {
540  template<typename T> struct GetRecordsResponse
541  {
546  tableName(std::string()),
547  typeName(std::string()),
548  typeSchema(std::string()),
549  data(std::vector<T>()),
550  totalNumberOfRecords(int64_t()),
551  hasMoreRecords(bool()),
552  info(std::map<std::string, std::string>())
553  {
554  }
555 
559  std::string tableName;
560 
561  std::string typeName;
562 
566  std::string typeSchema;
567 
573  std::vector<T> data;
574 
579 
584 
588  std::map<std::string, std::string> info;
589  };
590 } // end namespace gpudb
591 
592 #endif // __GET_RECORDS_H__
std::vector< T > data
If the encoding was 'binary', then this list contains the binary encoded records retrieved from the t...
Definition: get_records.h:573
std::string typeSchema
Avro schema of data or recordsJson.
Definition: get_records.h:566
GetRecordsRequest()
Constructs a GetRecordsRequest object with default parameters.
Definition: get_records.h:31
std::string encoding
Specifies the encoding for returned records; one of binary, json, or geojson.
Definition: get_records.h:280
int64_t limit
A positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to ...
Definition: get_records.h:264
std::string tableName
Name of the table or view from which the records will be fetched, in [ schema_name....
Definition: get_records.h:242
GetRecordsRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsRequest object with the specified parameters.
Definition: get_records.h:227
std::string tableName
Value of tableName.
Definition: get_records.h:559
int64_t offset
A positive integer indicating the number of initial results to skip (this can be useful for paging th...
Definition: get_records.h:250
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameters.
Definition: get_records.h:395
std::string tableName
Value of tableName.
Definition: get_records.h:410
std::string typeSchema
Avro schema of recordsBinary or recordsJson.
Definition: get_records.h:417
bool hasMoreRecords
Too many records.
Definition: get_records.h:444
A set of results returned by GPUdb::getRecordsRaw.
Definition: get_records.h:390
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: get_records.h:439
A set of results returned by GPUdb::getRecords.
Definition: get_records.h:540
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameters.
Definition: get_records.h:545
std::vector< std::string > recordsJson
If the encoding was 'json', then this list contains the JSON encoded records retrieved from the table...
Definition: get_records.h:434
std::map< std::string, std::string > info
Additional information.
Definition: get_records.h:449
A set of parameters for GPUdb::getRecords.
Definition: get_records.h:26
std::map< std::string, std::string > options
Definition: get_records.h:319
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: get_records.h:578
bool hasMoreRecords
Too many records.
Definition: get_records.h:583
GetRecordsRequest(const std::string &tableName_, const int64_t offset_, const int64_t limit_, const std::map< std::string, std::string > &options_)
Constructs a GetRecordsRequest object with the specified parameters.
Definition: get_records.h:120
std::vector< std::vector< uint8_t > > recordsBinary
If the encoding was 'binary', then this list contains the binary encoded records retrieved from the t...
Definition: get_records.h:424
std::map< std::string, std::string > info
Additional information.
Definition: get_records.h:588