GPUdb C++ API  Version 6.2.0.3
gpudb::AggregateStatisticsRequest Struct Reference

A set of input parameters for aggregateStatistics(const AggregateStatisticsRequest&) const. More...

#include <gpudb/protocol/aggregate_statistics.h>

Public Member Functions

 AggregateStatisticsRequest ()
 Constructs an AggregateStatisticsRequest object with default parameter values. More...
 
 AggregateStatisticsRequest (const std::string &tableName_, const std::string &columnName_, const std::string &stats_, const std::map< std::string, std::string > &options_)
 Constructs an AggregateStatisticsRequest object with the specified parameters. More...
 

Public Attributes

std::string tableName
 
std::string columnName
 
std::string stats
 
std::map< std::string, std::string > options
 

Detailed Description

A set of input parameters for aggregateStatistics(const AggregateStatisticsRequest&) const.

Calculates the requested statistics of the given column(s) in a given table.

The available statistics are count (number of total objects), mean, stdv (standard deviation), variance, skew, kurtosis, sum, min, max, weighted_average, cardinality (unique count), estimated_cardinality, percentile and percentile_rank.

Estimated cardinality is calculated by using the hyperloglog approximation technique.

Percentiles and percentile ranks are approximate and are calculated using the t-digest algorithm. They must include the desired percentile/percentile_rank. To compute multiple percentiles each value must be specified separately (i.e. 'percentile(75.0),percentile(99.0),percentile_rank(1234.56),percentile_rank(-5)').

A second, comma-separated value can be added to the percentile statistic to calculate percentile resolution, e.g., a 50th percentile with 200 resolution would be 'percentile(50,200)'.

The weighted average statistic requires a weight_column_name to be specified in options. The weighted average is then defined as the sum of the products of columnName times the weight_column_name values divided by the sum of the weight_column_name values.

Additional columns can be used in the calculation of statistics via the additional_column_names option. Values in these columns will be included in the overall aggregate calculation–individual aggregates will not be calculated per additional column. For instance, requesting the count & mean of columnName x and additional_column_names y & z, where x holds the numbers 1-10, y holds 11-20, and z holds 21-30, would return the total number of x, y, & z values (30), and the single average value across all x, y, & z values (15.5).

The response includes a list of key/value pairs of each statistic requested and its corresponding value.

Definition at line 54 of file aggregate_statistics.h.

Constructor & Destructor Documentation

◆ AggregateStatisticsRequest() [1/2]

gpudb::AggregateStatisticsRequest::AggregateStatisticsRequest ( )
inline

Constructs an AggregateStatisticsRequest object with default parameter values.

Definition at line 61 of file aggregate_statistics.h.

◆ AggregateStatisticsRequest() [2/2]

gpudb::AggregateStatisticsRequest::AggregateStatisticsRequest ( const std::string &  tableName_,
const std::string &  columnName_,
const std::string &  stats_,
const std::map< std::string, std::string > &  options_ 
)
inline

Constructs an AggregateStatisticsRequest object with the specified parameters.

Parameters
[in]tableName_Name of the table on which the statistics operation will be performed.
[in]columnName_Name of the primary column for which the statistics are to be calculated.
[in]stats_Comma separated list of the statistics to calculate, e.g. "sum,mean".
[in]options_Optional parameters.

Definition at line 146 of file aggregate_statistics.h.

Member Data Documentation

◆ columnName

std::string gpudb::AggregateStatisticsRequest::columnName

Definition at line 155 of file aggregate_statistics.h.

◆ options

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

Definition at line 157 of file aggregate_statistics.h.

◆ stats

std::string gpudb::AggregateStatisticsRequest::stats

Definition at line 156 of file aggregate_statistics.h.

◆ tableName

std::string gpudb::AggregateStatisticsRequest::tableName

Definition at line 154 of file aggregate_statistics.h.


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