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 
225  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_):
226  tableName( tableName_ ),
227  offset( offset_ ),
228  limit( limit_ ),
229  encoding( encoding_ ),
230  options( options_ )
231  {
232  }
233 
240  std::string tableName;
241 
248  int64_t offset;
249 
262  int64_t limit;
263 
277  std::string encoding;
278 
316  std::map<std::string, std::string> options;
317  };
318 } // end namespace gpudb
319 
320 namespace avro
321 {
322  template<> struct codec_traits<gpudb::GetRecordsRequest>
323  {
324  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
325  {
326  ::avro::encode(e, v.tableName);
327  ::avro::encode(e, v.offset);
328  ::avro::encode(e, v.limit);
329  ::avro::encode(e, v.encoding);
330  ::avro::encode(e, v.options);
331  }
332 
333  static void decode(Decoder& d, gpudb::GetRecordsRequest& v)
334  {
335  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
336  {
337  const std::vector<size_t> fo = rd->fieldOrder();
338 
339  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
340  {
341  switch (*it)
342  {
343  case 0:
344  ::avro::decode(d, v.tableName);
345  break;
346 
347  case 1:
348  ::avro::decode(d, v.offset);
349  break;
350 
351  case 2:
352  ::avro::decode(d, v.limit);
353  break;
354 
355  case 3:
356  ::avro::decode(d, v.encoding);
357  break;
358 
359  case 4:
360  ::avro::decode(d, v.options);
361  break;
362 
363  default:
364  break;
365  }
366  }
367  }
368  else
369  {
370  ::avro::decode(d, v.tableName);
371  ::avro::decode(d, v.offset);
372  ::avro::decode(d, v.limit);
373  ::avro::decode(d, v.encoding);
374  ::avro::decode(d, v.options);
375  }
376  }
377  };
378 } // end namespace avro
379 
380 namespace gpudb
381 {
388  {
393  tableName(std::string()),
394  typeName(std::string()),
395  typeSchema(std::string()),
396  recordsBinary(std::vector<std::vector<uint8_t> >()),
397  recordsJson(std::vector<std::string>()),
398  totalNumberOfRecords(int64_t()),
399  hasMoreRecords(bool()),
400  info(std::map<std::string, std::string>())
401  {
402  }
403 
407  std::string tableName;
408 
409  std::string typeName;
410 
414  std::string typeSchema;
415 
421  std::vector<std::vector<uint8_t> > recordsBinary;
422 
431  std::vector<std::string> recordsJson;
432 
437 
442 
446  std::map<std::string, std::string> info;
447  };
448 } // end namespace gpudb
449 
450 namespace avro
451 {
452  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
453  {
454  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
455  {
456  ::avro::encode(e, v.tableName);
457  ::avro::encode(e, v.typeName);
458  ::avro::encode(e, v.typeSchema);
459  ::avro::encode(e, v.recordsBinary);
460  ::avro::encode(e, v.recordsJson);
461  ::avro::encode(e, v.totalNumberOfRecords);
462  ::avro::encode(e, v.hasMoreRecords);
463  ::avro::encode(e, v.info);
464  }
465 
466  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
467  {
468  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
469  {
470  const std::vector<size_t> fo = rd->fieldOrder();
471 
472  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
473  {
474  switch (*it)
475  {
476  case 0:
477  ::avro::decode(d, v.tableName);
478  break;
479 
480  case 1:
481  ::avro::decode(d, v.typeName);
482  break;
483 
484  case 2:
485  ::avro::decode(d, v.typeSchema);
486  break;
487 
488  case 3:
489  ::avro::decode(d, v.recordsBinary);
490  break;
491 
492  case 4:
493  ::avro::decode(d, v.recordsJson);
494  break;
495 
496  case 5:
497  ::avro::decode(d, v.totalNumberOfRecords);
498  break;
499 
500  case 6:
501  ::avro::decode(d, v.hasMoreRecords);
502  break;
503 
504  case 7:
505  ::avro::decode(d, v.info);
506  break;
507 
508  default:
509  break;
510  }
511  }
512  }
513  else
514  {
515  ::avro::decode(d, v.tableName);
516  ::avro::decode(d, v.typeName);
517  ::avro::decode(d, v.typeSchema);
518  ::avro::decode(d, v.recordsBinary);
519  ::avro::decode(d, v.recordsJson);
520  ::avro::decode(d, v.totalNumberOfRecords);
521  ::avro::decode(d, v.hasMoreRecords);
522  ::avro::decode(d, v.info);
523  }
524  }
525  };
526 } // end namespace avro
527 
528 namespace gpudb
529 {
537  template<typename T> struct GetRecordsResponse
538  {
543  tableName(std::string()),
544  typeName(std::string()),
545  typeSchema(std::string()),
546  data(std::vector<T>()),
547  totalNumberOfRecords(int64_t()),
548  hasMoreRecords(bool()),
549  info(std::map<std::string, std::string>())
550  {
551  }
552 
556  std::string tableName;
557 
558  std::string typeName;
559 
563  std::string typeSchema;
564 
570  std::vector<T> data;
571 
576 
581 
585  std::map<std::string, std::string> info;
586  };
587 } // end namespace gpudb
588 
589 #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:570
std::string typeSchema
Avro schema of data or recordsJson.
Definition: get_records.h:563
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:277
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:262
std::string tableName
Name of the table or view from which the records will be fetched, in [ schema_name....
Definition: get_records.h:240
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:225
std::string tableName
Value of tableName.
Definition: get_records.h:556
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:248
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameters.
Definition: get_records.h:392
std::string tableName
Value of tableName.
Definition: get_records.h:407
std::string typeSchema
Avro schema of recordsBinary or recordsJson.
Definition: get_records.h:414
bool hasMoreRecords
Too many records.
Definition: get_records.h:441
A set of results returned by GPUdb::getRecordsRaw.
Definition: get_records.h:387
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: get_records.h:436
A set of results returned by GPUdb::getRecords.
Definition: get_records.h:537
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameters.
Definition: get_records.h:542
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:431
std::map< std::string, std::string > info
Additional information.
Definition: get_records.h:446
A set of parameters for GPUdb::getRecords.
Definition: get_records.h:26
std::map< std::string, std::string > options
Definition: get_records.h:316
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: get_records.h:575
bool hasMoreRecords
Too many records.
Definition: get_records.h:580
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:421
std::map< std::string, std::string > info
Additional information.
Definition: get_records.h:585