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
I found the source of the problem: I forgot to add the GROUP BY-clause because logically I do not want to group the result since there is already at most one value per hour due to the view definition. When I add the GROUP BY, I also have to add an AVG aggregate function to the "avg" since it is of course not part of the GROUP BY statement. Then I am able to add the interpolate-aggregate, too.
The final query looks like this:
SELECT time_bucket_gapfill('1 hour', "timestamp") AS"hourly", interpolate(AVG("avg")) AS"value", "sensor_uuid"FROM"measurement_hourly"WHERE"sensor_uuid"=1AND"timestamp">=now() - interval '1 week'AND"timestamp"<=now()
GROUP BY hourly, sensor_uuid
ORDER BY"hourly"ASC;
So it is not very intuitive and might be optimized but I guess, this issue should be closed.
Relevant system information:
Context
Assume there is a continuous aggregate view like this:
Now I want to do a
time_bucket_gapfill
statement on it like this:Because some sensors measure only once a day. So I really want to add
interpolate
but therefore I need atime_bucket_gapfill
first.Expected behavior
Actual behavior
Additional information
When I add the
interpolate
aggregation I get the same result.The text was updated successfully, but these errors were encountered: