GPUdb C++ API  Version 7.2.2.4
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 
255  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_):
256  tableName( tableName_ ),
257  columnNames( columnNames_ ),
258  variableColumnName( variableColumnName_ ),
259  valueColumnName( valueColumnName_ ),
260  pivotedColumns( pivotedColumns_ ),
261  encoding( "binary" ),
262  options( options_ )
263  {
264  }
265 
483  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_):
484  tableName( tableName_ ),
485  columnNames( columnNames_ ),
486  variableColumnName( variableColumnName_ ),
487  valueColumnName( valueColumnName_ ),
488  pivotedColumns( pivotedColumns_ ),
489  encoding( encoding_ ),
490  options( options_ )
491  {
492  }
493 
500  std::string tableName;
501 
506  std::vector<std::string> columnNames;
507 
512  std::string variableColumnName;
513 
517  std::string valueColumnName;
518 
524  std::vector<std::string> pivotedColumns;
525 
539  std::string encoding;
540 
664  std::map<std::string, std::string> options;
665  };
666 } // end namespace gpudb
667 
668 namespace avro
669 {
670  template<> struct codec_traits<gpudb::AggregateUnpivotRequest>
671  {
672  static void encode(Encoder& e, const gpudb::AggregateUnpivotRequest& v)
673  {
674  ::avro::encode(e, v.tableName);
675  ::avro::encode(e, v.columnNames);
676  ::avro::encode(e, v.variableColumnName);
677  ::avro::encode(e, v.valueColumnName);
678  ::avro::encode(e, v.pivotedColumns);
679  ::avro::encode(e, v.encoding);
680  ::avro::encode(e, v.options);
681  }
682 
683  static void decode(Decoder& d, gpudb::AggregateUnpivotRequest& v)
684  {
685  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
686  {
687  const std::vector<size_t> fo = rd->fieldOrder();
688 
689  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
690  {
691  switch (*it)
692  {
693  case 0:
694  ::avro::decode(d, v.tableName);
695  break;
696 
697  case 1:
698  ::avro::decode(d, v.columnNames);
699  break;
700 
701  case 2:
702  ::avro::decode(d, v.variableColumnName);
703  break;
704 
705  case 3:
706  ::avro::decode(d, v.valueColumnName);
707  break;
708 
709  case 4:
710  ::avro::decode(d, v.pivotedColumns);
711  break;
712 
713  case 5:
714  ::avro::decode(d, v.encoding);
715  break;
716 
717  case 6:
718  ::avro::decode(d, v.options);
719  break;
720 
721  default:
722  break;
723  }
724  }
725  }
726  else
727  {
728  ::avro::decode(d, v.tableName);
729  ::avro::decode(d, v.columnNames);
730  ::avro::decode(d, v.variableColumnName);
731  ::avro::decode(d, v.valueColumnName);
732  ::avro::decode(d, v.pivotedColumns);
733  ::avro::decode(d, v.encoding);
734  ::avro::decode(d, v.options);
735  }
736  }
737  };
738 } // end namespace avro
739 
740 namespace gpudb
741 {
748  {
754  tableName(std::string()),
755  responseSchemaStr(std::string()),
756  binaryEncodedResponse(std::vector<uint8_t>()),
757  jsonEncodedResponse(std::string()),
758  totalNumberOfRecords(int64_t()),
759  hasMoreRecords(bool()),
760  info(std::map<std::string, std::string>())
761  {
762  }
763 
768  std::string tableName;
769 
774  std::string responseSchemaStr;
775 
779  std::vector<uint8_t> binaryEncodedResponse;
780 
784  std::string jsonEncodedResponse;
785 
790 
795 
806  std::map<std::string, std::string> info;
807  };
808 } // end namespace gpudb
809 
810 namespace avro
811 {
812  template<> struct codec_traits<gpudb::RawAggregateUnpivotResponse>
813  {
814  static void encode(Encoder& e, const gpudb::RawAggregateUnpivotResponse& v)
815  {
816  ::avro::encode(e, v.tableName);
817  ::avro::encode(e, v.responseSchemaStr);
818  ::avro::encode(e, v.binaryEncodedResponse);
819  ::avro::encode(e, v.jsonEncodedResponse);
820  ::avro::encode(e, v.totalNumberOfRecords);
821  ::avro::encode(e, v.hasMoreRecords);
822  ::avro::encode(e, v.info);
823  }
824 
825  static void decode(Decoder& d, gpudb::RawAggregateUnpivotResponse& v)
826  {
827  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
828  {
829  const std::vector<size_t> fo = rd->fieldOrder();
830 
831  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
832  {
833  switch (*it)
834  {
835  case 0:
836  ::avro::decode(d, v.tableName);
837  break;
838 
839  case 1:
840  ::avro::decode(d, v.responseSchemaStr);
841  break;
842 
843  case 2:
844  ::avro::decode(d, v.binaryEncodedResponse);
845  break;
846 
847  case 3:
848  ::avro::decode(d, v.jsonEncodedResponse);
849  break;
850 
851  case 4:
852  ::avro::decode(d, v.totalNumberOfRecords);
853  break;
854 
855  case 5:
856  ::avro::decode(d, v.hasMoreRecords);
857  break;
858 
859  case 6:
860  ::avro::decode(d, v.info);
861  break;
862 
863  default:
864  break;
865  }
866  }
867  }
868  else
869  {
870  ::avro::decode(d, v.tableName);
871  ::avro::decode(d, v.responseSchemaStr);
872  ::avro::decode(d, v.binaryEncodedResponse);
873  ::avro::decode(d, v.jsonEncodedResponse);
874  ::avro::decode(d, v.totalNumberOfRecords);
875  ::avro::decode(d, v.hasMoreRecords);
876  ::avro::decode(d, v.info);
877  }
878  }
879  };
880 } // end namespace avro
881 
882 namespace gpudb
883 {
890  {
896  tableName(std::string()),
897  responseSchemaStr(std::string()),
898  data(std::vector<gpudb::GenericRecord>()),
899  totalNumberOfRecords(int64_t()),
900  hasMoreRecords(bool()),
901  info(std::map<std::string, std::string>()),
902  dataTypePtr((gpudb::Type*)NULL)
903  {
904  }
905 
910  std::string tableName;
911 
915  std::string responseSchemaStr;
916 
920  std::vector<gpudb::GenericRecord> data;
921 
926 
931 
942  std::map<std::string, std::string> info;
943 
945  };
946 } // end namespace gpudb
947 
948 #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.