influxdata / influxdata/kapacitor
Batch queries on data points that lie in the future
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
I'm currently trying to use kapacitor to program event triggers based on weather forecast data. These data are indexed on timestamps that can be up to one week in the future. However, from what I can tell, it seems that kapacitor is not able to run batch queries on data indexed by timestamps that lie in the future.
Let's say that the weather forecast data extends from the current time to 1 hour in the future.
A corresponding query would look something like:
```
SELECT mean(value) FROM hourly_forecast WHERE time > now() AND time < now() + 1h
```
I tried to replicate this in kapacitor by using a negative time offset, but it doesn't return any data points:
```
var data = batch
|query('SELECT mean(value) FROM "db"."rp"."hourly_forecast"')
.every(15m)
.offset(-1h)
```
I have tried a couple other approaches, but I can't seem to directly access data points that lie in the future.
Is it possible for kapacitor to query points that are in the future, or would I need to run a continuous query and save to a temporary measurement?
If not, would it be possible to introduce this feature?
Thanks!
Contributor guide
Research direction
Start by reproducing the batch query and negative .offset(-1h) example described in the issue with forecast points whose timestamps are in the future. Trace the batch-query behavior that excludes those points, then define completion as either supporting future-timestamp queries with coverage for this case or documenting the limitation and supported alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100