influxdata / influxdata/kapacitor
Join two nodes when one has no data
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
For example I have 2 metrics (temp1, temp2). But only one has incoming data. Maybe temp2 sensor is turned off, does not matter. For my condition ` "t1.value" > 0 OR "t2.value" > 0` temp2 is not relevant. But I didn't see in the log any point with prefix `P1` after join, join does not happen. So the question is how to make full outer join in my case?
PS. if temp2 has incoming data it works fine
```
var temp1 = batch
|query('SELECT mean(value) AS value FROM "my_db"."autogen".temp1')
.period(10s)
.every(5s)
.groupBy(time(2s), *)
.fill(0)
|log()
.prefix('P0-1')
.level('DEBUG')
var temp2 = batch
|query('SELECT mean(value) AS value FROM "my_db"."autogen".temp2')
.period(10s)
.every(5s)
.groupBy(time(2s), *)
.fill(0)
|log()
.prefix('P0-2')
.level('DEBUG')
temp1
|join(temp2)
.tolerance(5s)
.fill('null')
.as('t1', 't2')
|default()
.field('t1.value', -1)
.field('t2.value', -1)
|log()
.prefix('P1')
.level('DEBUG')
|where(lambda: "t1.value" > 0 OR "t2.value" > 0)
|alert()
```
Contributor guide
Research direction
Start with the supplied batch queries and the join() node, reproducing the case where temp2 has no incoming data and checking the tolerance and fill settings. Determine whether the join supports the requested full-outer behavior; done means documenting the supported configuration or defining the needed behavior and its tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- stream-processing
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100