influxdata / influxdata/influxql

Aggregate functions doesnot work with Limit values in InfluxQL query

Open
#63 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
170
Forks
50
PR merge metrics
No merged PRs in 30d

Description

I am using influx 2.7 v2 version with influx query. I have a scenario where I need to get min, max values of last 10 records. Query that I was using
select min(*) from "testapis" order by time desc limit 10; Shown as below
![image (1)](https://github.com/influxdata/influxql/assets/139781692/db53b90c-2646-4128-9a3f-0469e953cff6)
here are my last 10 records
select * from "testapis" order by time desc limit 10
![image](https://github.com/influxdata/influxql/assets/139781692/5944366d-d613-40f2-8bc6-85293ba67f95)

Do we have a way to address this ? or is there a work around ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the two InfluxQL queries against InfluxDB 2.7 and compare how ORDER BY, LIMIT, and min(*) are evaluated. Determine whether the aggregate is expected to operate on the limited records, then document the supported behavior or workaround; the issue names no source files or tests to begin with.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.