Skip to main content
aggregate_histogram(table_name=None, column_name=None, start=None, end=None, interval=None, options=)[source]

Performs a histogram calculation given a table, a column, and an interval function. The input parameter interval is used to produce bins of that size and the result, computed over the records falling within each bin, is returned. For each bin, the start value is inclusive, but the end value is exclusive–except for the very last bin for which the end value is also inclusive. The value returned for each bin is the number of records in it, except when a column name is provided as a value_column. In this latter case the sum of the values corresponding to the value_column is used as the result instead. The total number of bins requested cannot exceed 10,000.

NOTE: The Kinetica instance being accessed must be running a CUDA (GPU-based) build to service a request that specifies a value_column.

Parameters

table_name (str) –

Name of the table on which the operation will be performed. Must be an existing table, in [schema_name.]table_name format, using standard name resolution rules.

column_name (str) –

Name of a column or an expression of one or more column names over which the histogram will be calculated.

start (float) –

Lower end value of the histogram interval, inclusive.

end (float) –

Upper end value of the histogram interval, inclusive.

interval (float) –

The size of each bin within the start and end parameters.

options (dict of str to str) –

Optional parameters. Allowed keys are:

  • value_column – The name of the column to use when calculating the bin values (values are summed). The column must be a numerical type (int, double, long, float).

  • start – The start parameter for char types.

  • end – The end parameter for char types.

  • interval – The interval parameter for char types.

The default value is an empty dict ( ).

Returns

A dict with the following entries–

counts (list of floats) –

The array of calculated values that represents the histogram data points.

start (float) –

Value of input parameter start.

end (float) –

Value of input parameter end.

info (dict of str to str) –

Additional information.