influxdb-client-go icon indicating copy to clipboard operation
influxdb-client-go copied to clipboard

join.time result is empty

Open wuwenrufeng opened this issue 3 years ago • 2 comments

Specifications

  • Client Version: v2.10.0
  • InfluxDB Version: v.24
  • Platform: unbuntu22.04

Steps to reproduce

1.flux: flux1.flux `left = from(bucket: "alarm") |> range(start: -24h) |> filter(fn: (r) => r._measurement == "alarm" and strings.containsStr(v: r.taskName, substr: "a") and r.error == "type") |> group()

right = from(bucket: "alarm") |> range(start: -24h) |> filter(fn: (r) => r._measurement == "alarm_prevent") |> group()

joins = join.time( left: left, right: right, as: (l, r) => ({l with expiredField: r.expiredField}), ) yield joins` 2. flux flux1.flux, it return data 3.result, err := queryAPI.Query(context.Background(), fluxScriptStr); it return empty ...

Expected behavior

return data

Actual behavior

retrun empty

Additional info

No response

wuwenrufeng avatar Sep 27 '22 11:09 wuwenrufeng

@wuwenrufeng, does the query returns any data in Data Explorer? I see you are using the default join method 'inner' (w/o using the method param for join.time), which often leads to an empty result. If it works OK in Data Explorer, how do you read data using the client? Does the call result.Next() returns false? Do you check result.Err()?

vlastahajek avatar Sep 28 '22 16:09 vlastahajek

@wuwenrufeng, anything new?

vlastahajek avatar Oct 26 '22 11:10 vlastahajek