I am very new to aws timestream, but from the docs, it looks like the perfect place to add trade data. I was using this data to create a candlestick graph. But when there are long periods of time when no trade happened, the time series is not contiguous. Is there any way to make the time buckets contiguous by adding an empty candle (ie all 0 values) in all missing time buckets? I have read about INTERPOLATE_FILL but couldn't get how to use it correctly for my use case. Here is the query I'm currently using without any interpolation.
SELECT
BIN(time, 5m) as timestamp,
COALESCE(MAX(price),0) as high,
COALESCE(MIN(price),0) as low,
COALESCE(MAX_BY(price, time),0) as close,
COALESCE(MIN_BY(price, time),0) as open,
COALESCE(SUM(quantity),0) as volume
FROM "test"."test"
WHERE market = 'BTC/USDT' AND time BETWEEN from_iso8601_timestamp('2022-03-05T07:59:45.302Z') AND from_iso8601_timestamp('2023-03-05T07:59:45.302Z')
GROUP BY BIN(time, 5m)
ORDER BY timestamp DESC