Flux function fill() with influxdb 1.7.6

flux
#1

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.

from(bucket: "Export/autogen")  
|> range(start: 2019-00-00T00:00:00Z)  
|> filter(fn: (r) =>
      r._measurement == "Data" and
      r._field == "Value" and
      r.TagId == "23846"
    )   
|> fill(column: "_value", usePrevious: true)
|> yield()

It also does nothing when trying to change the fill() function to just

|> fill(usePrevious: true)

In https://community.influxdata.com/t/flux-fill-function-with-influxdb-1-x/9387 a staff member said that in v1.7.6 the fill function will be available again.

Is there any major mistake inmy code or ist there just a bug?

#2

Hi @Froonsoi, one of our engineers built 1.7.6 from source and fill worked for him. Have you tried using it with this syntax to see what happens?

from(bucket: "telegraf/autogen") |> range(start:-10m) |> filter(fn: (r) => r._measurement == "cpu") |> fill(value: 1.4)

#3

Hi, thanks for the reply.
I tried your syntax but it didn’t work.
It just ignores the fill function, but it catches if there is an error in it.

When I use the InfluxQL with the Query:

SELECT mean("Value") AS "mean_Value" FROM "Export"."autogen"."Data" WHERE time > :dashboardTime: AND "TagId"='23846' GROUP BY time(1m) FILL(previous)

I get my expected behavior.

With Flux:

A = from(bucket: "Export/autogen")  
|> range(start: 2019-01-01)  
|> filter(fn: (r) =>
      r._measurement == "Data" and
      r._field == "Value" and
      r.TagId == "23846"
    )   
  
|> fill(value: 12.0)
|> yield()

It get this:

Any Idea?
Thanks.

#4

Just to cover all our bases, can you run curl -sL -I localhost:8086/ping to check your version number?

#5

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?

#6

Curling gives me following result:

curl

I see your point. I tried to get as close to the InfluxQL Query but mean() and Group by() didnt make a difference

#7

Ok, so i’m very new but also had problems with fill() not wroking.
for some reason this works

from(bucket: "openhab_db")
  |> range(start: -2y, stop: -1y)
  |> filter(fn: (r) => r._measurement == "G_Temperature_wn8_pool" and r._field == "value")
  |> aggregateWindow(every: 3d, fn: mean)
  |> fill(usePrevious: true)  

but this one will come back with a hole in the results:

from(bucket: "openhab_db")
  |> range(start: -2y, stop: -1y)
  |> filter(fn: (r) => r._measurement == "G_Temperature_wn8_pool" and r._field == "value")
  |> fill(usePrevious: true)  
  |> aggregateWindow(every: 3d, fn: mean)

Notice the order when the fill is used

#8

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.

#9

@Froonsoi, does removing the mean and groupby from your InfluxQL query yield the same result as your Flux query?