influxdata / influxdata/influxdb

time for calculated query answers needs to reflect actual data

Open
#14,525 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

When influxdb is used to select an individual result, the time associated with it is returned. e.g., if I do:

SELECT LAST(x) FROM table WHERE ... time > now() - 1d ....

then influxdb will give me output with the timestamp set to the last row from "table".

However if I do a query like this:

SELECT MAX(x) - MIN(x) FROM table WHERE ... time > now() - 1d ....

then influxdb uses the value of "now() - 1d" as the timestamp for the result "MAX(x) - MIN(x)". This is not useful as it cannot be aligned with any other timestamps in influxdb.

Ideally the timestamp for "MAX(x) - MIN(x)" would come from the actual timestamp of either the row for MAX(x) or MIN(x), not "now() - 1d"/"now()".

Contributor guide

Open the contributing guide

Research direction

Start by tracing query execution for aggregate expressions and how result timestamps are assigned, comparing LAST(x) with MAX(x) - MIN(x). Confirm the intended timestamp semantics for rows contributing to calculated results, then add coverage showing that the result timestamp reflects actual data rather than the query-range boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.