influxdb: Subquery with fill(previous) unexpected behaviour
Bug report
System info: InfluxDB v1.4.2 CentOS Linux release 7.4.1708
Steps to reproduce:
- I have a Influxdb table where I store (among other data) the state of many VPSs, ir can be running, suspended or stopped, and the VPSs are identified by id as a tag, I want to know the total number of VPSs in each state.
- The query:
SELECT last("status") AS "status" FROM "tbh_vps"."autogen"."general" WHERE time > now() - 5m AND ("id"='22' OR "id"='41') GROUP BY time(30s), "id" FILL(previous)Returns the last 11 states of that 2 VPSs and I use fill(previous) because I gather data every 30 seconds and if I run te query after the node has sent the data the last state appears as null. - As I want the count and not individual states I use the last query as a subquery on:
SELECT count("status") FROM (SUBQUERIE) WHERE "status" = 'running' group by time(30s)
Expected behavior: I expect to return something like:
time count 01/15/18 04:22:30PM 2 01/15/18 04:23:00PM 2 01/15/18 04:23:30PM 2 01/15/18 04:24:00PM 2 01/15/18 04:24:30PM 2 01/15/18 04:25:00PM 2 01/15/18 04:25:30PM 2 01/15/18 04:26:00PM 2 01/15/18 04:26:30PM 2 01/15/18 04:27:00PM 2
Actual behavior:
It returns:
time count 1/15/2018 4:25:00 PM 1 1/15/2018 4:25:30 PM 1 1/15/2018 4:26:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:25:00 PM 1 1/15/2018 4:25:30 PM 1 1/15/2018 4:26:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:25:30 PM 1 1/15/2018 4:26:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:25:30 PM 1 1/15/2018 4:26:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:26:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:26:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:26:30 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:27:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:27:30 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:28:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:28:30 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:29:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1 1/15/2018 4:29:30 PM 1 1/15/2018 4:30:00 PM 1
Actually the only diference between the expected behavior and the actual behavior if that if I do not include the fill(previous) in the subquery it works as expected so I suppose there is a problem with the fill(previous) behaviour inside subqueries.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 6
- Comments: 16 (2 by maintainers)
No investigation for that problem? It seems to be a major issue and it removes a lot of advantages of the
FILLfunction.