Hello
I’m quite new to Flux lang and I’m having trouble testing the join.inner()
function.
I tested it by joining data coming from real buckets or generated with array.from()
function and all went ok.
Then I test it with data generated with generate.from()
function by I can’t get any result back. Here the snippet failing to return expected result :
// Generate data
t1 =
generate.from(
count: 4,
fn: (n) => n + 1,
start: 2024-02-14T13:21:56Z,
stop: 2024-02-14T13:22:36Z,
)
|> set(key: "tag", value: "foo")
|> group(columns: ["_time"])
|> yield(name: "t1")
t2 =
generate.from(
count: 4,
fn: (n) => n + 2,
start: 2024-02-14T13:21:56Z,
stop: 2024-02-14T13:22:36Z,
)
|> set(key: "tag", value: "foo")
|> group(columns: ["_time"])
|> yield(name: "t2")
result = join.inner(
left: t1,
right: t2,
on: (l, r) => l._time == r._time,
as: (l, r) => ({l with rightValue: r._value}),
)
|> yield(name: "RESULT")
Am I missing something? If I use the plain join()
function everything works fine.