I just updated my Influxdb to the latest 1.7.6 version (flux v0.24) and wonderd that the fill() function is not showing up in the FLUX FUNCTIONS dropdown. The does not throw any Error, it just simply does not do anything.
There are two things that I’m noticing in your InfluxQL query that are different from your Flux query: you’re using mean and you’re grouping by time. Could that be causing the difference?
Hi @Maciej_Eckstein, fill(usePrevious: true) will fail if there is a nil value being used as the fill value, and flux will have problems with a calculation that has nil values. The order of fill matters, and you may also have to add a fill with a default value.
I do not exactly understand yourpoint. If you could explain it a bit more.
My pool temp measument has no values in the DB for a about a week. So both query with aggregateWindow(every: 3d, fn: mean) and without has null datapoints. Then fill() should behave similar. However it does not. Same query in th IQL is flawless but there you dont have and issue of order.
Hello @Maciej_Eckstein,
Can you please share your input and expected output data? In line protocol? Aggregate window can create additional null values which can help explain why order matters. For example if I run
from(bucket: "telegraf/autogen")
|> range(start:-24h)
|> filter(fn: (r) => r._measurement == "cpu"
and r._field == "usage_user" and r.cpu == "cpu-total")
I don’t have any null values so
fill(usePrevious:true)
doesn’t have any effect if I use it immediately after. However now if I do
I’m asking influx to generate a point for usage_user when telegraf wasn’t running and I wasn’t collecting any data, so it will create a null values (probably when I was sleeping and my computer was off). Now if I use fill() it will have an effect.
Ok that makes sense. The order is important in Flux becouse the null points are accualy introduced by the agregateWindow(). In my case I had no mesurments for a week. so with the window of 1d or 3d I made null points this way. Fill needs to be next and that works fine.
Some major change of thinking is required to use flux.