influxdata / flux

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.

Home Page:https://influxdata.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InfluxDB showing invalid memory address when filtering value which donot exists

pratikdas44 opened this issue · comments

**Wanted - Filter out the value in influxdb, for which a point does not exists

Expected behavior:
InfluxDB should show nothing (no error should come)

Actual behavior:
InfluxDB showing invalid memory address or nil pointer dereference**

**Environment info:

InfluxDB version: 2.0.9 where the query is working, and 2.4.0 where query is not working**

Below is the query -

import "strings"
import "date"
import "regexp"
src_bucket = "test_bucket"
src_measurement = "gnb_om"
start_time = 2023-03-28T04:00:00Z
stop_time = 2023-03-28T05:00:00Z

from(bucket: src_bucket)
|> range(start: start_time,stop: stop_time)
|> filter(fn: (r) => r["_measurement"] == src_measurement)
|> filter(fn: (r) => r["_field"] == "VS_HO_Msg3RcvdCountforSgNBAddition" or r["_field"] == "OR_ENDCPROCEDURE_SgnbAddAttemptCell" )
|> truncateTimeColumn(unit: 1m)
|> toFloat()
|> group(columns: ["_time","NID","cell"])
|> aggregateWindow(every: 1h, fn: count)
//|> filter(fn: (r) => r["_value"] == 1)
|> yield(name: "count")
|> findRecord(fn: (key) => true, idx: 0)

Csv file can be found here - https://community.influxdata.com/t/influxdb-showing-invalid-memory-address-when-filtering-value-which-donot-exists/29463

This issue has had no recent activity and will be closed soon.