influxdata / influxdata/influxdb
Join creating empty rows
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Maybe im _holding it wrong_ but I can't figure out why this should be expected behavior?
I know that I don't have to use a join in this specific case, it's only for demonstration.
__Config:__
Version 2.0.0 (37cc047)
__Steps to reproduce:__
When querying as seen below the results will contain a row for EVERY time increment (10s in this case) have a look:
```go
container1 = from(bucket: "temptest")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "GrafanatestData")
|> filter(fn: (r) => r["_field"] == "A")
|> aggregateWindow(every: 10s, fn: mean)
|> drop(columns: ["_stop", "_start", "_measurement", "_field"])
container2 = from(bucket: "temptest")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "GrafanatestData")
|> filter(fn: (r) => r["_field"] == "B")
|> aggregateWindow(every: 10s, fn: mean)
|> drop(columns: ["_stop", "_start", "_measurement", "_field"])
join(tables: {t1: container1, t2: container2}, on: ["_time"])
```

[2021-01-08-15-37_chronograf_data.csv.txt](https://github.com/influxdata/influxdb/files/5787739/2021-01-08-15-37_chronograf_data.csv.txt)
A side problem of this behavior are enormous query executing times or even timeouts...
__Expected behavior:__
Resulting only in rows where data is present?

[2021-01-08-15-38_chronograf_data.csv.txt](https://github.com/influxdata/influxdb/files/5787742/2021-01-08-15-38_chronograf_data.csv.txt)
Contributor guide
Research direction
Start by reproducing the supplied query with the two containers, aggregateWindow calls, and join on _time. Compare the generated rows with the expected result and investigate why empty time increments are included, including the reported query timeouts; done means the join returns only rows where data is present.
Written by the indexing model from the issue text.
Assessment
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100