GPUdb C++ API  Version 5.2.0.0
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 a given column 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)').

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

The response includes a list of the statistics requested along with the count of the number of items in the given set.

Definition at line 40 of file aggregate_statistics.h.

Constructor & Destructor Documentation

gpudb::AggregateStatisticsRequest::AggregateStatisticsRequest ( )
inline

Constructs an AggregateStatisticsRequest object with default parameter values.

Definition at line 47 of file aggregate_statistics.h.

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]tableNameName of the table on which the statistics operation will be performed.
[in]columnNameName of the column for which the statistics are to be calculated.
[in]statsComma separated list of the statistics to calculate, e.g. "sum,mean". Values: 'count', 'mean', 'stdv', 'variance', 'skew', 'kurtosis', 'sum', 'min', 'max', 'weighted_average', 'cardinality', 'estimated_cardinality', 'percentile', 'percentile_rank'.
[in]optionsOptional parameters.
  • additional_column_names: A list of comma separated column names over which statistics can be accumulated along with the primary column.
  • weight_column_name: Name of column used as weighting attribute for the weighted average statistic.
Default value is an empty std::map.

Definition at line 82 of file aggregate_statistics.h.

Member Data Documentation

std::string gpudb::AggregateStatisticsRequest::columnName

Definition at line 91 of file aggregate_statistics.h.

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

Definition at line 93 of file aggregate_statistics.h.

std::string gpudb::AggregateStatisticsRequest::stats

Definition at line 92 of file aggregate_statistics.h.

std::string gpudb::AggregateStatisticsRequest::tableName

Definition at line 90 of file aggregate_statistics.h.


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