influxdata / influxdata/influxdb

LIMIT and SORT keywords are not work in query

Open
#24,353 1 comment 1 reaction 0 assignees View on GitHub
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:
![image](https://github.com/influxdata/influxdb/assets/80509361/8864769a-904f-49bb-9126-ba8312ea3772)

Please tell me the reason, thanks so much!

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.