InfluxElixir.Client.Local.SQLAggregate (InfluxElixir v0.1.40)

Copy Markdown View Source

The aggregates of a SQL select list for InfluxElixir.Client.Local, over the points of one group, as InfluxDB 3 computes them (verified against Core).

A null result (an aggregate over no values, a sample statistic of one value, a missing grouping value) is left out of the row, as the real engine does; COUNT is 0, never null. A result that is an infinity or a NaN is a null that is there (see InfluxElixir.Client.Local.SQLNumber).

  • SUM of an Int64 or a UInt64 wraps; MEDIAN of two of them wraps their sum before halving (the median of [9223372036854775807, 9223372036854775807] is -1)
  • AVG and the statistics are Float64; over a decimal AVG is refused by name (the engine gives it four more places)
  • the sample statistics need at least two values; the population forms are defined for one

Summary

Types

A group's points.

Functions

An aggregate over the non-null values of one group.

One output row of an aggregate or grouped select list: each column over the group's points; bucket_ts is the group's DATE_BIN bucket start.

Types

points()

A group's points.

Functions

compute(arg1, values)

An aggregate over the non-null values of one group.

reduce_columns(columns, points, bucket_ts)

@spec reduce_columns(
  [InfluxElixir.Client.Local.SQLSelect.column()],
  points(),
  integer() | nil
) :: map()

One output row of an aggregate or grouped select list: each column over the group's points; bucket_ts is the group's DATE_BIN bucket start.