Skip to main content

build_aggregate_query

Function build_aggregate_query 

Source
pub fn build_aggregate_query(
    table_name: &str,
    function: AggregateFunction,
    group_by: &GroupBy,
    _columns: &[&str],
    from_timestamp: Option<i64>,
    to_timestamp: Option<i64>,
) -> String
Expand description

Builds a SQL query for aggregation.

This is the core query builder used by specific aggregation implementations. It provides a flexible way to build SQL queries for different types of time-series data aggregation.

§Arguments

  • table_name - The source table name
  • function - The aggregation function to apply
  • group_by - The grouping specification
  • columns - The columns to aggregate
  • from_timestamp - Optional start of the time range
  • to_timestamp - Optional end of the time range

§Returns

A SQL query string for the specified aggregation