Note

This documentation is for a prior release of Kinetica. For the latest documentation, click here.

/aggregate/histogram

URL: http://<db.host>:<db.port>/aggregate/histogram

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.

Input Parameter Description

NameTypeDescription
table_namestringName 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_namestringName of a column or an expression of one or more column names over which the histogram will be calculated.
startdoubleLower end value of the histogram interval, inclusive.
enddoubleUpper end value of the histogram interval, inclusive.
intervaldoubleThe size of each bin within the start and end parameters.
optionsmap of string to strings

Optional parameters. The default value is an empty map ( {} ).

Supported Parameters (keys)Parameter Description
value_columnThe 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).

Output Parameter Description

The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:

NameTypeDescription
statusString'OK' or 'ERROR'
messageStringEmpty if success or an error message
data_typeString'aggregate_histogram_response' or 'none' in case of an error
dataStringEmpty string
data_strJSON or String

This embedded JSON represents the result of the /aggregate/histogram endpoint:

NameTypeDescription
countsarray of doublesThe array of calculated values that represents the histogram data points.
startdoubleValue of input parameter start.
enddoubleValue of input parameter end.
infomap of string to stringsAdditional information.

Empty string in case of an error.