Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a logical exception in the GROUP BY TIME clause of the aggregate function. #25635

Open
LingweiKuang opened this issue Dec 10, 2024 · 1 comment
Assignees
Labels
area/influxql Issues related to InfluxQL query language area/queries kind/bug team/edge

Comments

@LingweiKuang
Copy link

Dear InfluxDB Team, When performing an aggregate query using the GROUP BY TIME clause, if the time_interval and offset_interval are not equal, the query will return a large amount of data with invalid timestamps.

Steps to reproduce

In the latest version of InfluxDB, if we have an organization named "organization", we can use the Influx client to execute the following commands to create a bucket and write the specified data into that bucket.

influx bucket delete --name db0
influx bucket create --name db0 --org organization

influx write \
  -b db0 \
  -o organization \
  -p ns \
  't0,t0_tag0=initTag t0_f0=1 1641024000000000000'

Next, we use the influx v1 shell command to enter the Influx shell backend and execute the following query statement:

# query 1
SELECT COUNT(t0_f0) FROM db0.autogen.t0 WHERE time <= 1641024000000000000 GROUP BY time(8000s,8000s);

# query 2
SELECT COUNT(t0_f0) FROM db0.autogen.t0 WHERE time <= 1641024000000000000 GROUP BY time(8000s,6000s);

Expected behaviour

Query 1 returned result set: 1

Query 2 returned result set: 1

Actual behaviour

Query 1 returned result set: 1

Query 2 returned result set: 1, and a large amount of invalid data.

Environment info

Influx CLI dev (git: a79a2a1b825867421d320428538f76a4c90aa34c) build_date: 2024-04-16T14:34:32Z

InfluxDB OSS v2.7.11 (git: fbf5d4a)

Linux 5.15.0-94-generic x86_64

@LingweiKuang
Copy link
Author

There is a logical exception in the GROUP BY TIME clause of the aggregate function

@davidby-influx davidby-influx self-assigned this Dec 18, 2024
@davidby-influx davidby-influx added area/queries area/influxql Issues related to InfluxQL query language kind/bug team/edge labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxql Issues related to InfluxQL query language area/queries kind/bug team/edge
Projects
None yet
Development

No branches or pull requests

2 participants