Skip to main content

◆ aggregateStatistics() [1/4]

AggregateStatisticsResponse gpudb::GPUdb::aggregateStatistics (const AggregateStatisticsRequest &request_) 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 to be specified in weight_column_name. 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 additional_column_names. 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 and mean of columnName x and additional_column_names y and 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, and z values (30), and the single average value across all x, y, and z values (15.5).

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

Parameters
[in]request_Request object containing the parameters for the operation.
Returns
Response object containing the result of the operation.

◆ aggregateStatistics() [2/4]

AggregateStatisticsResponse & gpudb::GPUdb::aggregateStatistics (const AggregateStatisticsRequest &request_,
AggregateStatisticsResponse &response_ ) 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 to be specified in weight_column_name. 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 additional_column_names. 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 and mean of columnName x and additional_column_names y and 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, and z values (30), and the single average value across all x, y, and z values (15.5).

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

Parameters
[in]request_Request object containing the parameters for the operation.
[out]response_Response object containing the results of the operation.
Returns
Response object containing the result of the operation (initially passed in by reference).

◆ aggregateStatistics() [3/4]

AggregateStatisticsResponse gpudb::GPUdb::aggregateStatistics (const std::string &tableName,
const std::string &columnName,
const std::string &stats,
const std::map< std::string, std::string > &options ) 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 to be specified in weight_column_name. 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 additional_column_names. 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 and mean of columnName x and additional_column_names y and 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, and z values (30), and the single average value across all x, y, and z values (15.5).

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

Parameters
[in]tableNameName of the table on which the statistics operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.
[in]columnNameName of the primary column for which the statistics are to be calculated.
[in]statsComma separated list of the statistics to calculate, e.g. “sum,mean”. Supported values:
[in]optionsOptional parameters.
  • aggregate_statistics_additional_column_names: A list of comma separated column names over which statistics can be accumulated along with the primary column. All columns listed and columnName must be of the same type. Must not include the column specified in columnName and no column can be listed twice.
  • aggregate_statistics_weight_column_name: Name of column used as weighting attribute for the weighted average statistic.
The default value is an empty map.
Returns
Response object containing the result of the operation.

◆ aggregateStatistics() [4/4]

AggregateStatisticsResponse & gpudb::GPUdb::aggregateStatistics (const std::string &tableName,
const std::string &columnName,
const std::string &stats,
const std::map< std::string, std::string > &options,
AggregateStatisticsResponse &response_ ) 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 to be specified in weight_column_name. 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 additional_column_names. 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 and mean of columnName x and additional_column_names y and 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, and z values (30), and the single average value across all x, y, and z values (15.5).

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

Parameters
[in]tableNameName of the table on which the statistics operation will be performed, in [schema_name.]table_name format, using standard name resolution rules.
[in]columnNameName of the primary column for which the statistics are to be calculated.
[in]statsComma separated list of the statistics to calculate, e.g. “sum,mean”. Supported values:
[in]optionsOptional parameters.
  • aggregate_statistics_additional_column_names: A list of comma separated column names over which statistics can be accumulated along with the primary column. All columns listed and columnName must be of the same type. Must not include the column specified in columnName and no column can be listed twice.
  • aggregate_statistics_weight_column_name: Name of column used as weighting attribute for the weighted average statistic.
The default value is an empty map.
[out]response_Response object containing the results of the operation.
Returns
Response object containing the result of the operation (initially passed in by reference).