This code executes an innerjoin operation on an influx.db My expectation is that a new table should be returned with entries that are common for booth input tables.
But it returns nothing.
import "join"
// The first query on the influx DB, returning the left stream
left =
from(bucket: "IoT_Prod")
|> range(start: -1d)
|> filter(fn: (r) => r["_field"] == "aanvoer_temp")
|> filter(fn: (r) => r["CV_status"] == "hwc")
|> aggregateWindow(every: 1h, fn: last, createEmpty: false)
|> yield(name: "hwc")
// The second query on the influx DB, returning the right stream
right =
from(bucket: "IoT_Prod")
|> range(start: -1d)
|> filter(fn: (r) => r["_field"] == "geleverd gas")
|> aggregateWindow(every: 1h , fn: mean, createEmpty: false)
|> yield(name: "gas")
// The inner join operation that should return a DB with common lines on time entry.
join.inner(
left : left,
right : right,
// Statement to filter on those lines with time is equal on both streams.
on : (l,r) => l._time == r._time,
// The structucture of the data that should be returned.
as : (l,r) => ({join_time: r._time, join_value : r._value, join_field : r._field, join_CV_status : l.CV_status}),
)
The result is the following output …