Influxdb: GROUP BY clause not working

Created on 20 Apr 2017  路  9Comments  路  Source: influxdata/influxdb

Bug report

__System info:__ [
* InfluxDB version : 1.2
* OS - Windows 10
* Type - Local Instance]

__Steps to reproduce:__

1 - Create 2 measurements having the same schema and write data into one of them through line protocol(say Measurement A) and using the Java API to the other(say Measurement B)

2 - Query using GROUP BY clause on a string field in both the measurements

The queries I used was :-
"select * from summary_jm group by batch_no" - Measurement A
"select * from summary_jm group by batch_no" - Measurement B

*Behaves as expected in Measurement A whereas the results are not grouped in Measurement B.

__Expected behavior:__ Both results should be grouped based on the specified field

__Actual behavior:__ Results from B are not grouped

__Additional info:__ [Include gist of relevant config, logs, etc.]

Please note, the quickest way to fix a bug is to open a Pull Request.

1.x wontfix

Most helpful comment

It is happening to us with bandwidth usage data for dozens of hosts.

This is our query. It returns correct values for percentile but empty values for recv and sent:

select percentile(total_bytes, 95) AS percentile, sum(recv_bytes) as recv, sum(sent_bytes) as sent from bandwidth_usage where time >= 1491036363000000000 and time < 1493628363000000000 group by host;

Changing the query to select data from a single host works ok:

select percentile(total_bytes, 95) AS percentile, sum(recv_bytes) as recv, sum(sent_bytes) as sent from bandwidth_usage where host = 'somehost' and time >= 1491036363000000000 and time < 1493628363000000000;

System info:

  • InfluxDB version : 1.2.2
  • OS - CentOS 7

All 9 comments

It is happening to us with bandwidth usage data for dozens of hosts.

This is our query. It returns correct values for percentile but empty values for recv and sent:

select percentile(total_bytes, 95) AS percentile, sum(recv_bytes) as recv, sum(sent_bytes) as sent from bandwidth_usage where time >= 1491036363000000000 and time < 1493628363000000000 group by host;

Changing the query to select data from a single host works ok:

select percentile(total_bytes, 95) AS percentile, sum(recv_bytes) as recv, sum(sent_bytes) as sent from bandwidth_usage where host = 'somehost' and time >= 1491036363000000000 and time < 1493628363000000000;

System info:

  • InfluxDB version : 1.2.2
  • OS - CentOS 7

Can you show us the Java code? It seems to me like that's the root of the problem and the issue should likely be filed in https://github.com/influxdata/influxdb-java.

I believe this bug is related to the one I described over on the community forum:
https://community.influxdata.com/t/selecting-both-mean-percentiles-produces-non-deterministic-results/1705/2

Dummy data

cpu,host=a value=1 1434155562000000000
cpu,host=a value=2 1434265562000000000
cpu,host=b value=3 1434375562000000000
cpu,host=b value=4 1422568543702900257

Query
select sum(value), percentile(value, 75) from cpu group by host

_(the sum function can be replaced with mean/median/mode/percentile and the query still wont work)_

which incorrectly returns:

host | sum | percentile
a    | 3   | __
b    | 7   | 4
a    | __  | 2

instead of what it should have returned:

host | sum | percentile
a    | 3   | 2
b    | 7   | 4

However the query does work if the percentile is changed to be any value below 75 (i.e. 74), or the data is inserted using timestamps close together (i.e. omitting the timestamps when inserting the data)

+1

+1

Is this the same issue?
https://community.influxdata.com/t/query-results-in-empty-for-some-points-when-using-group-by/7820

My influxdb version is 1.2, too. And the aggregate functions sometimes doesn't work.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmke picture dmke  路  45Comments

beckettsean picture beckettsean  路  83Comments

phemmer picture phemmer  路  60Comments

jsternberg picture jsternberg  路  57Comments

pauldix picture pauldix  路  89Comments