GPUdb C++ API  Version 7.2.3.0
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 
118  GetRecordsRequest(const std::string& tableName_, const int64_t offset_, const int64_t limit_, const std::map<std::string, std::string>& options_):
119  tableName( tableName_ ),
120  offset( offset_ ),
121  limit( limit_ ),
122  encoding( "binary" ),
123  options( options_ )
124  {
125  }
126 
223  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_):
224  tableName( tableName_ ),
225  offset( offset_ ),
226  limit( limit_ ),
227  encoding( encoding_ ),
228  options( options_ )
229  {
230  }
231 
238  std::string tableName;
239 
246  int64_t offset;
247 
260  int64_t limit;
261 
276  std::string encoding;
277 
315  std::map<std::string, std::string> options;
316  };
317 } // end namespace gpudb
318 
319 namespace avro
320 {
321  template<> struct codec_traits<gpudb::GetRecordsRequest>
322  {
323  static void encode(Encoder& e, const gpudb::GetRecordsRequest& v)
324  {
325  ::avro::encode(e, v.tableName);
326  ::avro::encode(e, v.offset);
327  ::avro::encode(e, v.limit);
328  ::avro::encode(e, v.encoding);
329  ::avro::encode(e, v.options);
330  }
331 
332  static void decode(Decoder& d, gpudb::GetRecordsRequest& v)
333  {
334  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
335  {
336  const std::vector<size_t> fo = rd->fieldOrder();
337 
338  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
339  {
340  switch (*it)
341  {
342  case 0:
343  ::avro::decode(d, v.tableName);
344  break;
345 
346  case 1:
347  ::avro::decode(d, v.offset);
348  break;
349 
350  case 2:
351  ::avro::decode(d, v.limit);
352  break;
353 
354  case 3:
355  ::avro::decode(d, v.encoding);
356  break;
357 
358  case 4:
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.offset);
371  ::avro::decode(d, v.limit);
372  ::avro::decode(d, v.encoding);
373  ::avro::decode(d, v.options);
374  }
375  }
376  };
377 } // end namespace avro
378 
379 namespace gpudb
380 {
387  {
392  tableName(std::string()),
393  typeName(std::string()),
394  typeSchema(std::string()),
395  recordsBinary(std::vector<std::vector<uint8_t> >()),
396  recordsJson(std::vector<std::string>()),
397  totalNumberOfRecords(int64_t()),
398  hasMoreRecords(bool()),
399  info(std::map<std::string, std::string>())
400  {
401  }
402 
406  std::string tableName;
407 
408  std::string typeName;
409 
413  std::string typeSchema;
414 
420  std::vector<std::vector<uint8_t> > recordsBinary;
421 
430  std::vector<std::string> recordsJson;
431 
436 
441 
445  std::map<std::string, std::string> info;
446  };
447 } // end namespace gpudb
448 
449 namespace avro
450 {
451  template<> struct codec_traits<gpudb::RawGetRecordsResponse>
452  {
453  static void encode(Encoder& e, const gpudb::RawGetRecordsResponse& v)
454  {
455  ::avro::encode(e, v.tableName);
456  ::avro::encode(e, v.typeName);
457  ::avro::encode(e, v.typeSchema);
458  ::avro::encode(e, v.recordsBinary);
459  ::avro::encode(e, v.recordsJson);
460  ::avro::encode(e, v.totalNumberOfRecords);
461  ::avro::encode(e, v.hasMoreRecords);
462  ::avro::encode(e, v.info);
463  }
464 
465  static void decode(Decoder& d, gpudb::RawGetRecordsResponse& v)
466  {
467  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
468  {
469  const std::vector<size_t> fo = rd->fieldOrder();
470 
471  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
472  {
473  switch (*it)
474  {
475  case 0:
476  ::avro::decode(d, v.tableName);
477  break;
478 
479  case 1:
480  ::avro::decode(d, v.typeName);
481  break;
482 
483  case 2:
484  ::avro::decode(d, v.typeSchema);
485  break;
486 
487  case 3:
488  ::avro::decode(d, v.recordsBinary);
489  break;
490 
491  case 4:
492  ::avro::decode(d, v.recordsJson);
493  break;
494 
495  case 5:
496  ::avro::decode(d, v.totalNumberOfRecords);
497  break;
498 
499  case 6:
500  ::avro::decode(d, v.hasMoreRecords);
501  break;
502 
503  case 7:
504  ::avro::decode(d, v.info);
505  break;
506 
507  default:
508  break;
509  }
510  }
511  }
512  else
513  {
514  ::avro::decode(d, v.tableName);
515  ::avro::decode(d, v.typeName);
516  ::avro::decode(d, v.typeSchema);
517  ::avro::decode(d, v.recordsBinary);
518  ::avro::decode(d, v.recordsJson);
519  ::avro::decode(d, v.totalNumberOfRecords);
520  ::avro::decode(d, v.hasMoreRecords);
521  ::avro::decode(d, v.info);
522  }
523  }
524  };
525 } // end namespace avro
526 
527 namespace gpudb
528 {
536  template<typename T> struct GetRecordsResponse
537  {
542  tableName(std::string()),
543  typeName(std::string()),
544  typeSchema(std::string()),
545  data(std::vector<T>()),
546  totalNumberOfRecords(int64_t()),
547  hasMoreRecords(bool()),
548  info(std::map<std::string, std::string>())
549  {
550  }
551 
555  std::string tableName;
556 
557  std::string typeName;
558 
562  std::string typeSchema;
563 
569  std::vector<T> data;
570 
575 
580 
584  std::map<std::string, std::string> info;
585  };
586 } // end namespace gpudb
587 
588 #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:569
std::string typeSchema
Avro schema of data or recordsJson.
Definition: get_records.h:562
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:276
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:260
std::string tableName
Name of the table or view from which the records will be fetched, in [ schema_name....
Definition: get_records.h:238
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:223
std::string tableName
Value of tableName.
Definition: get_records.h:555
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:246
RawGetRecordsResponse()
Constructs a RawGetRecordsResponse object with default parameters.
Definition: get_records.h:391
std::string tableName
Value of tableName.
Definition: get_records.h:406
std::string typeSchema
Avro schema of recordsBinary or recordsJson.
Definition: get_records.h:413
bool hasMoreRecords
Too many records.
Definition: get_records.h:440
A set of results returned by GPUdb::getRecordsRaw.
Definition: get_records.h:386
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: get_records.h:435
A set of results returned by GPUdb::getRecords.
Definition: get_records.h:536
GetRecordsResponse()
Constructs a GetRecordsResponse object with default parameters.
Definition: get_records.h:541
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:430
std::map< std::string, std::string > info
Additional information.
Definition: get_records.h:445
A set of parameters for GPUdb::getRecords.
Definition: get_records.h:26
std::map< std::string, std::string > options
Definition: get_records.h:315
int64_t totalNumberOfRecords
Total/Filtered number of records.
Definition: get_records.h:574
bool hasMoreRecords
Too many records.
Definition: get_records.h:579
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:118
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:420
std::map< std::string, std::string > info
Additional information.
Definition: get_records.h:584