Open afpgit opened 8 months ago
Hello @afpgit,
Thanks for reaching out. The reported behavior is the expected behavior of a continuous aggregate using time_bucket
. When no data is available in the raw hypertable, no data is available in the continuous aggregate.
However, there are two different time_bucket functions available in TimescaleDB: time_bucket and time_bucket_gapfill. time_bucket_gapfill
is intended to fill the gaps of missing data with previous values.
So, time_bucket_gapfill
is intended to handle use-cases like yours. Unfortunately, time_bucket_gapfill
is currently not supported in continuous aggregates (see #1324). I will keep the issue open but re-label it from bug to enhancement.
What type of bug is this?
Incorrect result
What subsystems and features are affected?
Continuous aggregate
What happened?
Problem: missing OHLC bars (candlestick) for financial data when there is no transaction.
I am expecting that even if the tick data is missing for that period, it still produces a new bar with Open=High=Low=Closed=Previous closed.
I have a tick table in timescaledb as follows from which I create a materialized view for 1-minute OHLC bars with its corresponding refresh policy. However, my
tick_1min
table does not end up having the correct OHLC bar and there are missing bars in the table, as can be seen in below. I have created a trigger signal that whenever the OHLC is created in the table a client is notified and will act upon the new data to process the update.materialized view for 1-minute OHLC bars
Missing rows in
tick_1min
, e.g., data from 22:25:00 to 22:28:00 is not added (with expected Open=High=Low=Closed=Previous closed)TimescaleDB version affected
2.10.2
PostgreSQL version used
14.7
What operating system did you use?
Ubuntu 14.7-1.pgdg22.04+1
What installation method did you use?
Docker
What platform did you run on?
Other
Relevant log output and stack trace
No response
How can we reproduce the bug?