GPUdb C++ API  Version 7.2.3.0
aggregate_unpivot.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 __AGGREGATE_UNPIVOT_H__
7 #define __AGGREGATE_UNPIVOT_H__
8 
9 #include "../GenericRecord.hpp"
10 
11 namespace gpudb
12 {
37  {
43  tableName(std::string()),
44  columnNames(std::vector<std::string>()),
45  variableColumnName(std::string()),
46  valueColumnName(std::string()),
47  pivotedColumns(std::vector<std::string>()),
48  encoding(std::string("binary")),
49  options(std::map<std::string, std::string>())
50  {
51  }
52 
262  AggregateUnpivotRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const std::string& variableColumnName_, const std::string& valueColumnName_, const std::vector<std::string>& pivotedColumns_, const std::map<std::string, std::string>& options_):
263  tableName( tableName_ ),
264  columnNames( columnNames_ ),
265  variableColumnName( variableColumnName_ ),
266  valueColumnName( valueColumnName_ ),
267  pivotedColumns( pivotedColumns_ ),
268  encoding( "binary" ),
269  options( options_ )
270  {
271  }
272 
497  AggregateUnpivotRequest(const std::string& tableName_, const std::vector<std::string>& columnNames_, const std::string& variableColumnName_, const std::string& valueColumnName_, const std::vector<std::string>& pivotedColumns_, const std::string& encoding_, const std::map<std::string, std::string>& options_):
498  tableName( tableName_ ),
499  columnNames( columnNames_ ),
500  variableColumnName( variableColumnName_ ),
501  valueColumnName( valueColumnName_ ),
502  pivotedColumns( pivotedColumns_ ),
503  encoding( encoding_ ),
504  options( options_ )
505  {
506  }
507 
514  std::string tableName;
515 
520  std::vector<std::string> columnNames;
521 
526  std::string variableColumnName;
527 
531  std::string valueColumnName;
532 
538  std::vector<std::string> pivotedColumns;
539 
553  std::string encoding;
554 
683  std::map<std::string, std::string> options;
684  };
685 } // end namespace gpudb
686 
687 namespace avro
688 {
689  template<> struct codec_traits<gpudb::AggregateUnpivotRequest>
690  {
691  static void encode(Encoder& e, const gpudb::AggregateUnpivotRequest& v)
692  {
693  ::avro::encode(e, v.tableName);
694  ::avro::encode(e, v.columnNames);
695  ::avro::encode(e, v.variableColumnName);
696  ::avro::encode(e, v.valueColumnName);
697  ::avro::encode(e, v.pivotedColumns);
698  ::avro::encode(e, v.encoding);
699  ::avro::encode(e, v.options);
700  }
701 
702  static void decode(Decoder& d, gpudb::AggregateUnpivotRequest& v)
703  {
704  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
705  {
706  const std::vector<size_t> fo = rd->fieldOrder();
707 
708  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
709  {
710  switch (*it)
711  {
712  case 0:
713  ::avro::decode(d, v.tableName);
714  break;
715 
716  case 1:
717  ::avro::decode(d, v.columnNames);
718  break;
719 
720  case 2:
721  ::avro::decode(d, v.variableColumnName);
722  break;
723 
724  case 3:
725  ::avro::decode(d, v.valueColumnName);
726  break;
727 
728  case 4:
729  ::avro::decode(d, v.pivotedColumns);
730  break;
731 
732  case 5:
733  ::avro::decode(d, v.encoding);
734  break;
735 
736  case 6:
737  ::avro::decode(d, v.options);
738  break;
739 
740  default:
741  break;
742  }
743  }
744  }
745  else
746  {
747  ::avro::decode(d, v.tableName);
748  ::avro::decode(d, v.columnNames);
749  ::avro::decode(d, v.variableColumnName);
750  ::avro::decode(d, v.valueColumnName);
751  ::avro::decode(d, v.pivotedColumns);
752  ::avro::decode(d, v.encoding);
753  ::avro::decode(d, v.options);
754  }
755  }
756  };
757 } // end namespace avro
758 
759 namespace gpudb
760 {
767  {
773  tableName(std::string()),
774  responseSchemaStr(std::string()),
775  binaryEncodedResponse(std::vector<uint8_t>()),
776  jsonEncodedResponse(std::string()),
777  totalNumberOfRecords(int64_t()),
778  hasMoreRecords(bool()),
779  info(std::map<std::string, std::string>())
780  {
781  }
782 
787  std::string tableName;
788 
793  std::string responseSchemaStr;
794 
798  std::vector<uint8_t> binaryEncodedResponse;
799 
803  std::string jsonEncodedResponse;
804 
809 
814 
825  std::map<std::string, std::string> info;
826  };
827 } // end namespace gpudb
828 
829 namespace avro
830 {
831  template<> struct codec_traits<gpudb::RawAggregateUnpivotResponse>
832  {
833  static void encode(Encoder& e, const gpudb::RawAggregateUnpivotResponse& v)
834  {
835  ::avro::encode(e, v.tableName);
836  ::avro::encode(e, v.responseSchemaStr);
837  ::avro::encode(e, v.binaryEncodedResponse);
838  ::avro::encode(e, v.jsonEncodedResponse);
839  ::avro::encode(e, v.totalNumberOfRecords);
840  ::avro::encode(e, v.hasMoreRecords);
841  ::avro::encode(e, v.info);
842  }
843 
844  static void decode(Decoder& d, gpudb::RawAggregateUnpivotResponse& v)
845  {
846  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
847  {
848  const std::vector<size_t> fo = rd->fieldOrder();
849 
850  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
851  {
852  switch (*it)
853  {
854  case 0:
855  ::avro::decode(d, v.tableName);
856  break;
857 
858  case 1:
859  ::avro::decode(d, v.responseSchemaStr);
860  break;
861 
862  case 2:
863  ::avro::decode(d, v.binaryEncodedResponse);
864  break;
865 
866  case 3:
867  ::avro::decode(d, v.jsonEncodedResponse);
868  break;
869 
870  case 4:
871  ::avro::decode(d, v.totalNumberOfRecords);
872  break;
873 
874  case 5:
875  ::avro::decode(d, v.hasMoreRecords);
876  break;
877 
878  case 6:
879  ::avro::decode(d, v.info);
880  break;
881 
882  default:
883  break;
884  }
885  }
886  }
887  else
888  {
889  ::avro::decode(d, v.tableName);
890  ::avro::decode(d, v.responseSchemaStr);
891  ::avro::decode(d, v.binaryEncodedResponse);
892  ::avro::decode(d, v.jsonEncodedResponse);
893  ::avro::decode(d, v.totalNumberOfRecords);
894  ::avro::decode(d, v.hasMoreRecords);
895  ::avro::decode(d, v.info);
896  }
897  }
898  };
899 } // end namespace avro
900 
901 namespace gpudb
902 {
909  {
915  tableName(std::string()),
916  responseSchemaStr(std::string()),
917  data(std::vector<gpudb::GenericRecord>()),
918  totalNumberOfRecords(int64_t()),
919  hasMoreRecords(bool()),
920  info(std::map<std::string, std::string>()),
921  dataTypePtr((gpudb::Type*)NULL)
922  {
923  }
924 
929  std::string tableName;
930 
934  std::string responseSchemaStr;
935 
939  std::vector<gpudb::GenericRecord> data;
940 
945 
950 
961  std::map<std::string, std::string> info;
962 
964  };
965 } // end namespace gpudb
966 
967 #endif // __AGGREGATE_UNPIVOT_H__
int64_t totalNumberOfRecords
Total/Filtered number of records.
boost::shared_ptr< Type > gpudb_type_ptr_t
std::string responseSchemaStr
Avro schema of data or jsonEncodedResponse.
std::map< std::string, std::string > info
Additional information.
std::vector< std::string > columnNames
List of column names or expressions.
std::vector< uint8_t > binaryEncodedResponse
Avro binary encoded response.
AggregateUnpivotRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const std::string &variableColumnName_, const std::string &valueColumnName_, const std::vector< std::string > &pivotedColumns_, const std::string &encoding_, const std::map< std::string, std::string > &options_)
Constructs an AggregateUnpivotRequest object with the specified parameters.
std::string tableName
Typically shows the result-table name if provided in the request (Ignore otherwise).
std::string variableColumnName
Specifies the variable/parameter column name.
A set of results returned by GPUdb::aggregateUnpivot.
std::string valueColumnName
Specifies the value column name.
RawAggregateUnpivotResponse()
Constructs a RawAggregateUnpivotResponse object with default parameters.
std::map< std::string, std::string > info
Additional information.
std::string tableName
Typically shows the result-table name if provided in the request (Ignore otherwise).
AggregateUnpivotRequest(const std::string &tableName_, const std::vector< std::string > &columnNames_, const std::string &variableColumnName_, const std::string &valueColumnName_, const std::vector< std::string > &pivotedColumns_, const std::map< std::string, std::string > &options_)
Constructs an AggregateUnpivotRequest object with the specified parameters.
AggregateUnpivotRequest()
Constructs an AggregateUnpivotRequest object with default parameters.
A set of results returned by GPUdb::aggregateUnpivotRaw.
std::vector< gpudb::GenericRecord > data
Avro binary encoded response.
bool hasMoreRecords
Too many records.
std::map< std::string, std::string > options
Optional parameters.
std::string jsonEncodedResponse
Avro JSON encoded response.
AggregateUnpivotResponse()
Constructs an AggregateUnpivotResponse object with default parameters.
std::string tableName
Name of the table on which the operation will be performed.
A set of parameters for GPUdb::aggregateUnpivot.
std::string responseSchemaStr
Avro schema of binaryEncodedResponse or jsonEncodedResponse.
std::string encoding
Specifies the encoding for returned records.
std::vector< std::string > pivotedColumns
List of one or more values typically the column names of the input table.
int64_t totalNumberOfRecords
Total/Filtered number of records.