You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a 1-minute materialized view where the value col is average(time_weighted('linear' ... )) as value with 3 entries in the source data table at (seconds, value) [(0,1), (10, 11), (50, 51)] the expected output for the time weighted average is 30.17.
Create a materialized view at 1 minute agg pulling data from a table with start_time, value columns. Create aggregation with value as described above. (actual sql is on work machine and not sure if I'm allowed to share)
The text was updated successfully, but these errors were encountered:
What type of bug is this?
Incorrect result
What subsystems and features are affected?
Continuous aggregate
What happened?
When creating a 1-minute materialized view where the value col is
average(time_weighted('linear' ... )) as value
with 3 entries in the source data table at (seconds, value) [(0,1), (10, 11), (50, 51)] the expected output for the time weighted average is30.17
.Expected equivalent calculation
(((1 + 11) / 2) * 10 + ((11 + 51) / 2) * 40 + ((51 + 51) / 2) * 10) / 60
The materialized view yields a value of
26.0
TimescaleDB version affected
2.14.2
PostgreSQL version used
15.6
What operating system did you use?
MacOS
What installation method did you use?
Docker
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
No response
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: