GPUdb C++ API  Version 5.2.0.0
gpudb::AggregateGroupByRequest Struct Reference

A set of input parameters for aggregateGroupByRaw(const AggregateGroupByRequest&) const. More...

#include <gpudb/protocol/aggregate_group_by.h>

Public Member Functions

 AggregateGroupByRequest ()
 Constructs an AggregateGroupByRequest object with default parameter values. More...
 
 AggregateGroupByRequest (const std::string &tableName, const std::vector< std::string > &columnNames, const int64_t offset, const int64_t limit, const std::map< std::string, std::string > &options)
 Constructs an AggregateGroupByRequest object with the specified parameters. More...
 
 AggregateGroupByRequest (const std::string &tableName, const std::vector< std::string > &columnNames, const int64_t offset, const int64_t limit, const std::string &encoding, const std::map< std::string, std::string > &options)
 Constructs an AggregateGroupByRequest object with the specified parameters. More...
 

Public Attributes

std::string tableName
 
std::vector< std::string > columnNames
 
int64_t offset
 
int64_t limit
 
std::string encoding
 
std::map< std::string, std::string > options
 

Detailed Description

A set of input parameters for aggregateGroupByRaw(const AggregateGroupByRequest&) const.

Calculates unique combinations (groups) of values for the given columns in a given table/view/collection and computes aggregates on each unique combination. This is somewhat analogous to an SQL-style SELECT...GROUP BY. Any column(s) can be grouped on, but only non-string (i.e. numeric) columns may be used for computing aggregates. The results can be paged via the offset and limit parameters. For example, to get 10 groups with the largest counts the inputs would be: limit=10, options={"sort_order":"descending", "sort_by":"value"}. options can be used to customize behavior of this call e.g. filtering or sorting the results. To group by 'x' and 'y' and compute the number of objects within each group, use column_names=['x','y','count(*)']. To also compute the sum of 'z' over each group, use column_names=['x','y','count(*)','sum(z)']. Available aggregation functions are: 'count(*)', 'sum', 'min', 'max', 'avg', 'mean', 'stddev', 'stddev_pop', 'stddev_samp', 'var', 'var_pop', 'var_samp', 'arg_min', 'arg_max' and 'count_distinct'. The response is returned as a dynamic schema. For details see: dynamic schemas documentation. If the 'result_table' option is provided then the results are stored in a table with the name given in the option and the results are not returned in the response.

Definition at line 40 of file aggregate_group_by.h.

Constructor & Destructor Documentation

gpudb::AggregateGroupByRequest::AggregateGroupByRequest ( )
inline

Constructs an AggregateGroupByRequest object with default parameter values.

Definition at line 47 of file aggregate_group_by.h.

gpudb::AggregateGroupByRequest::AggregateGroupByRequest ( const std::string &  tableName,
const std::vector< std::string > &  columnNames,
const int64_t  offset,
const int64_t  limit,
const std::map< std::string, std::string > &  options 
)
inline

Constructs an AggregateGroupByRequest object with the specified parameters.

Parameters
[in]tableNameName of the table on which the operation will be performed. Must be a valid table/view/collection in GPUdb.
[in]columnNamesList of one or more column names, expressions, and aggregate expressions. Must include at least one 'grouping' column or expression. If no aggregate is included, count(*) will be computed as a default.
[in]offsetA positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The minimum allowed value is 0. The maximum allowed value is MAX_INT.
[in]limitA positive integer indicating the maximum number of results to be returned Or END_OF_SET (-9999) to indicate that the max number of results should be returned. Default value is 1000.
[in]optionsOptional parameters.
  • expression: Filter expression to apply to the table prior to computing the aggregate group by.
  • having: Filter expression to apply to the aggregated results.
  • sort_order: String indicating how the returned values should be sorted - ascending or descending. Values: 'ascending', 'descending'.
  • sort_by: String determining how the results are sorted. Values: 'key', 'value'.
  • result_table: The name of the table used to store the results. If present no results are returned in the response.
Default value is an empty std::map.

Definition at line 97 of file aggregate_group_by.h.

gpudb::AggregateGroupByRequest::AggregateGroupByRequest ( const std::string &  tableName,
const std::vector< std::string > &  columnNames,
const int64_t  offset,
const int64_t  limit,
const std::string &  encoding,
const std::map< std::string, std::string > &  options 
)
inline

Constructs an AggregateGroupByRequest object with the specified parameters.

Parameters
[in]tableNameName of the table on which the operation will be performed. Must be a valid table/view/collection in GPUdb.
[in]columnNamesList of one or more column names, expressions, and aggregate expressions. Must include at least one 'grouping' column or expression. If no aggregate is included, count(*) will be computed as a default.
[in]offsetA positive integer indicating the number of initial results to skip (this can be useful for paging through the results). The minimum allowed value is 0. The maximum allowed value is MAX_INT.
[in]limitA positive integer indicating the maximum number of results to be returned Or END_OF_SET (-9999) to indicate that the max number of results should be returned. Default value is 1000.
[in]encodingSpecifies the encoding for returned records. Values: 'binary', 'json'. Default value is 'binary'.
[in]optionsOptional parameters.
  • expression: Filter expression to apply to the table prior to computing the aggregate group by.
  • having: Filter expression to apply to the aggregated results.
  • sort_order: String indicating how the returned values should be sorted - ascending or descending. Values: 'ascending', 'descending'.
  • sort_by: String determining how the results are sorted. Values: 'key', 'value'.
  • result_table: The name of the table used to store the results. If present no results are returned in the response.
Default value is an empty std::map.

Definition at line 150 of file aggregate_group_by.h.

Member Data Documentation

std::vector<std::string> gpudb::AggregateGroupByRequest::columnNames

Definition at line 161 of file aggregate_group_by.h.

std::string gpudb::AggregateGroupByRequest::encoding

Definition at line 164 of file aggregate_group_by.h.

int64_t gpudb::AggregateGroupByRequest::limit

Definition at line 163 of file aggregate_group_by.h.

int64_t gpudb::AggregateGroupByRequest::offset

Definition at line 162 of file aggregate_group_by.h.

std::map<std::string, std::string> gpudb::AggregateGroupByRequest::options

Definition at line 165 of file aggregate_group_by.h.

std::string gpudb::AggregateGroupByRequest::tableName

Definition at line 160 of file aggregate_group_by.h.


The documentation for this struct was generated from the following file: