Support numeric aggregations on intervals
We can add two intervals, but we cannot sum a column of them.
It would also be nice to have the rest of the numeric aggregations such as avg, stddev, and variance for intervals.
Some potential use cases for real time aggregations on intervals that I can think of off the top of my head:
- What is the current avg/stddev/var wait-time between somebody calling a call center and that somebody actually talking to a human?
- What is the avg/stddev/var duration of some recurring anomalous event? How many human-hours are spent per time period on dealing with the recurring anomalous event?
My current workaround for the lack of aggregations on intervals is to EXTRACT EPOCH from them, and do aggregations on them as floats.
As a quick drive-by comment: the numeric aggregations are currently "those that we can cast to an i128 and perform addition on". Intervals are a bit wonky (with months and times and stuff) but I think if we can convert them to i128 we should be good. It might make sense for this to happen in the SQL -> Dataflow conversion, though, vs educating dataflow about each of the aggregates.