GPUdb C++ API
Version 6.2.0.3
|
A set of output parameters for aggregateGroupBy(const AggregateGroupByRequest&) const. More...
#include <gpudb/protocol/aggregate_group_by.h>
Public Member Functions | |
AggregateGroupByResponse () | |
Constructs an AggregateGroupByResponse object with default parameter values. More... | |
Public Attributes | |
std::string | responseSchemaStr |
std::vector< gpudb::GenericRecord > | data |
int64_t | totalNumberOfRecords |
bool | hasMoreRecords |
gpudb_type_ptr_t | dataTypePtr |
A set of output parameters for aggregateGroupBy(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.
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 792 of file aggregate_group_by.h.
|
inline |
Constructs an AggregateGroupByResponse object with default parameter values.
Definition at line 799 of file aggregate_group_by.h.
std::vector<gpudb::GenericRecord> gpudb::AggregateGroupByResponse::data |
Definition at line 809 of file aggregate_group_by.h.
gpudb_type_ptr_t gpudb::AggregateGroupByResponse::dataTypePtr |
Definition at line 812 of file aggregate_group_by.h.
bool gpudb::AggregateGroupByResponse::hasMoreRecords |
Definition at line 811 of file aggregate_group_by.h.
std::string gpudb::AggregateGroupByResponse::responseSchemaStr |
Definition at line 808 of file aggregate_group_by.h.
int64_t gpudb::AggregateGroupByResponse::totalNumberOfRecords |
Definition at line 810 of file aggregate_group_by.h.