we are using InfluxDB v1.8 for our time-series measurements that we capture with ROS. We mainly rely on the feature of GROUP BY time(timeinterval) to synchronize our measurement data.
Previously, we had a configuration .json file which we used for a Python script, that would then generate the SQL query in the form of
SELECT $$SIGNALS$$ FROM "$$MEASUREMENT$$" WHERE time >= $$STARTTIME$$ms and time <= $$ENDTIME$$ms GROUP BY time($$SAMPLETIME$$) fill(previous);
where for every Field ($$SIGNALS$$ in the above template) we are interested in, we would append
mean("$$SIGNAL$$") AS "$$SIGNAL$$" seperated by comman and space, of course.
Now to avoid having to type out every interesting Field in the measurement, because we capture a lot of signals and have changing sensor setups, I would like to simply query all Fields in the measurement, so
But, as I mentioned, the
GROUP BY time(timeinterval) function is important to us. Since this function requires a InfluxQL function in the SELECT statement, as pointed out here in the docs, this won’t work right away.
In a previous issue on this forum here, the solution was to use
SELECT FIRST(*). Now, some ROS messages can be dynamic, so that means the number of objects, e.g. an image detection listing all objects in the picture, can change over time. I suspect that this method thus won’t work for me, since this cuts down the measurement to the first point in time where all Fields have had data for the first time. If the maximum number of objects is reached at any other point in time than at measurement start, the measurement will get shortened by this query.
The other proposed method in this thread was to use
GROUP BY *,time(__), but I also haven’t managed to get that working.
Could you please help me formulate the InfluxQL query in such a way that
SELECT * and
GROUP BY time(timeinterval) work at the same time when not all Fields provide a value at measurement start and the fill(previous) method is not changed?