Hello guys. I have the following simple query:
from(bucket:"bots-requests-stats")
|> range(start: -1h)
|> group(columns: ["_field"])
|> sum()
It’s ok. But if I add a simple and always true condition:
from(bucket:"bots-requests-stats")
|> range(start: -1h)
|> filter(fn:(r) => "All" == "All")
|> group(columns: ["_field"])
|> sum()
Then query’s result table have a different columns set. Here is both queries results:
Why does it happen and how do I avoid this? Thank in advance
Hello @Alexander_Kochagov,
Can you please export some data and share it with me?
I just did a test with some dummy data and the results were consistent for me:
mymeas,mytag=foo myfield=1
mymeas,mytag=foo myfield=2
mymeas,mytag=foo myfield2=1
mymeas,mytag=foo myfield2=2
from(bucket: "test")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "mymeas")
|> group(columns: ["_field"])
|> sum()
|> yield(name: "mean")
and
from(bucket: "test")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> group(columns: ["_field"])
|> sum()
|> yield(name: "mean")