GPUdb C++ API  Version 7.0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gpudb::AggregateGroupByRequest Struct Reference

A set of input parameters for 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 const.

Calculates unique combinations (groups) of values for the given columns in a given table or view and computes aggregates on each unique combination. This is somewhat analogous to an SQL-style SELECT...GROUP BY.

For aggregation details and examples, see Aggregation. For limitations, see Aggregation Limitations.

Any column(s) can be grouped on, and all column types except unrestricted-length strings may be used for computing applicable aggregates; columns marked as store-only are unable to be used in grouping or aggregation.

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 columns '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.

Available grouping functions are Rollup, Cube, and Grouping Sets

This service also provides support for Pivot operations.

Filtering on aggregates is supported via expressions using aggregation functions supplied to having.

The response is returned as a dynamic schema. For details see: dynamic schemas documentation.

If a result_table name is specified in the options, the results are stored in a new table with that name–no results are returned in the response. Both the table name and resulting column names must adhere to standard naming conventions; column/aggregation expressions will need to be aliased. If the source table's shard key is used as the grouping column(s) and all result records are selected (offset is 0 and limit is -9999), the result table will be sharded, in all other cases it will be replicated. Sorting will properly function only if the result table is replicated or if there is only one processing node and should not be relied upon in other cases. Not available when any of the values of columnNames is an unrestricted-length string.

Definition at line 85 of file aggregate_group_by.h.

Constructor & Destructor Documentation

gpudb::AggregateGroupByRequest::AggregateGroupByRequest ( )
inline

Constructs an AggregateGroupByRequest object with default parameter values.

Definition at line 92 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]tableName_Name of an existing table or view on which the operation will be performed.
[in]columnNames_List of one or more column names, expressions, and aggregate expressions.
[in]offset_A 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]limit_A 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. The number of records returned will never exceed the server's own limit, defined by the max_get_records_size parameter in the server configuration. Use hasMoreRecords to see if more records exist in the result to be fetched, and offset & limit to request subsequent pages of results.
[in]options_Optional parameters.

Definition at line 288 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]tableName_Name of an existing table or view on which the operation will be performed.
[in]columnNames_List of one or more column names, expressions, and aggregate expressions.
[in]offset_A 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]limit_A 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. The number of records returned will never exceed the server's own limit, defined by the max_get_records_size parameter in the server configuration. Use hasMoreRecords to see if more records exist in the result to be fetched, and offset & limit to request subsequent pages of results.
[in]encoding_Specifies the encoding for returned records. The default value is gpudb::aggregate_group_by_binary.
[in]options_Optional parameters.

Definition at line 495 of file aggregate_group_by.h.

Member Data Documentation

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

Definition at line 506 of file aggregate_group_by.h.

std::string gpudb::AggregateGroupByRequest::encoding

Definition at line 509 of file aggregate_group_by.h.

int64_t gpudb::AggregateGroupByRequest::limit

Definition at line 508 of file aggregate_group_by.h.

int64_t gpudb::AggregateGroupByRequest::offset

Definition at line 507 of file aggregate_group_by.h.

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

Definition at line 510 of file aggregate_group_by.h.

std::string gpudb::AggregateGroupByRequest::tableName

Definition at line 505 of file aggregate_group_by.h.


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