influxdata / influxdata/influxdb
[1.x,2.x] Subqueries do not correctly handle aggregation functions
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
It seems Influx (v1.8) doesn't handle aggregation functions on subqueries correctly, or I'm misunderstanding how they should behave.
__Steps to reproduce:__
List the minimal actions needed to reproduce the behaviour.
1. Make a query with a LIMIT, return a handful of rows.
2. Make a query with an aggregator function, using the first query in the FROM.
__Expected behaviour:__
The aggregator function is correctly applied to the rows returned by the subquery.
__Actual behaviour:__
I have no idea what calculation is done now, but it's not the expected result.
__Environment info:__
* Version: 1.8
Example:

I would expect the sum of 1 + 1 + 0 + 0 + 0 to be 2, not 5.
Contributor guide
Assessment
This issue has not been assessed yet.