influxdata / influxdata/influxdb
[2.0] sort function doesn't work when re-assignment to _time
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Running InfluxDB 2.0
This is my code of save data to influxDB

Running flux query
from(bucket: "test-idm-bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["equipmentNo"] == "3fb38f9c-be57-43bd-bf1b-ede34df20d22")
|> filter(fn: (r) => r["_field"] == "ljll")
|> sort(columns: ["_time"], desc: true)
Return result

I find it that sort function doesn't work. Is it caused by my re-assignment to _time?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided Flux query against InfluxDB 2.0, including the reassignment to _time, and compare the returned ordering with sort(columns: ["_time"], desc: true). No source file or test is named; determine whether the behavior is caused by the reassignment, then identify the relevant implementation or test and confirm the corrected ordering.
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
- Mostly clear
- Newbie friendliness
- 35/100