influxdata / influxdata/influxdb
LIMIT and SORT keywords are not work in query
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
My influxdb version is 2.7.0, when I query data with LIMIT and SORT keywords, but they are not work.
It did not sort, and response all data.
The QL like this:
from(bucket: "iot-platform")
|> range(start: -1h)
|> filter(fn: (r) => r["_measurement"] == "sensor_data")
|> filter(fn: (r) => r["project_code"] == "ca3a3cbc")
|> sort(columns: ["time"], desc: true)
|> limit(n:10, offset: 0)
And the result like this:

Please tell me the reason, thanks so much!
Contributor guide
Research direction
Reproduce the Flux query against InfluxDB 2.7.0 and confirm whether sort order and the ten-row limit are ignored. Start by tracing the query execution for the sort and limit operations; done means the result is sorted by time descending and contains only ten rows. No source files or tests are named, so locating the relevant code will require project familiarity.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100