> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# aggregate_histogram

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/aggregate_histogram.rs#L39-L56)
pub async fn [aggregate\_histogram](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/aggregate-histogram.md#method.aggregate_histogram)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), start: [f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html), end: [f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html), interval: [f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Perform a histogram calculation given a table, column, and interval functionPerforms a histogram calculation given a table, a column, and an interval function. The `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.

##### Arguments

<ul>
  <li>`table_name` - 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.</li>
  <li>`column_name` - Name of a column or an expression of one or more column names over which the histogram will be calculated.</li>
  <li>`start` - Lower end value of the histogram interval, inclusive.</li>
  <li>`end` - Upper end value of the histogram interval, inclusive.</li>
  <li>`interval` - The size of each bin within the start and end parameters.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/aggregate_histogram.rs#L87-L111)
pub async fn [aggregate\_histogram\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/aggregate-histogram.md#method.aggregate_histogram_with_opts)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), start: [f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html), end: [f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html), interval: [f64](https://doc.rust-lang.org/1.98.1/std/primitive.f64.html), options: [AggregateHistogramRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Perform a histogram calculation given a table, column, and interval functionPerforms a histogram calculation given a table, a column, and an interval function. The `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.

##### Arguments

<ul>
  <li>`table_name` - 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.</li>
  <li>`column_name` - Name of a column or an expression of one or more column names over which the histogram will be calculated.</li>
  <li>`start` - Lower end value of the histogram interval, inclusive.</li>
  <li>`end` - Upper end value of the histogram interval, inclusive.</li>
  <li>`interval` - The size of each bin within the start and end parameters.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/aggregate_histogram.rs#L114-L125)
pub async fn [aggregate\_histogram\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/aggregate-histogram.md#method.aggregate_histogram_raw)( \&self, request: &[AggregateHistogramRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`AggregateHistogramRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramRequest) to the `/aggregate/histogram` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/aggregate_histogram.rs#L129-L141)
pub async fn [aggregate\_histogram\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/aggregate-histogram.md#method.aggregate_histogram_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[AggregateHistogramRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[AggregateHistogramResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`AggregateHistogramRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.AggregateHistogramRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.