influxdata / influxdata/influxql

Modify TimeRange to support relative time ranges

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
170
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Modify TimeRange to support relative time ranges. This is primarily to allow the influxql to flux transpiler to read an influxql expression and generate relative time ranges instead of always generating an absolute time range. It then means the transpiler doesn't need to know what the current time is.

One caveat that flux doesn't have to deal with, but we likely do, is that it is unclear what the following query should do:

```
WHERE time >= '2018-07-09T09:00:00Z' AND time >= now() - 1h
```

If we do not evaluate the `now() - 1h`, we can't know which one of these is the correct time range. It would be possible for us to include all of the constraints in the `TimeRange` struct and evaluate them when we know what `now()` is, but it probably wouldn't get us any closer to our ultimate goal of generating a `range()` operation with the appropriate arguments. But, the above is perfectly valid influxql even if it is a bit nonsensical.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the TimeRange definition and the InfluxQL-to-Flux transpiler entry points. Read how absolute ranges and now() expressions are currently represented, then determine the intended behavior when absolute and relative constraints coexist. Done means relative time ranges can be represented for transpilation without requiring the transpiler to know the current time.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.