Hi,
I have a strange / unexpected transformation outer join result if one of the query results is empty. I wonder if anyone else has come across this and has a good solution?
To illustrate (with some pseudo-results):
1) If my query results are:
- a: {1,2,3,4)
- b: {3,4,5,6}
I see:
a | b
-----+-----
1 | null
2 | null
3 | 3
4 | 4
null | 5
null | 6
So far, so good.
2) If my query results are:
- a: {1,2,3,4)
- b: {3,4}
I see:
a | b
-----+-----
1 | null
2 | null
3 | 3
4 | 4
Still all good.
But…
3) If my query results are:
- a: {1,2,3,4)
- b: {}
I would hope to see:
a | b
-----+-----
1 | null
2 | null
3 | null
4 | null
…but I actually get:
nothing
![]()
What I’m attempting to do is join my various metrics with ALERTS from Alertmanager (this is the b query above). The problem is, if I have no alerts I’d really like to still show my metrics (from query a) with a useful “OK” status (or something like that). But it’s not working out like that…
- If I have alerts on some metrics, I see the table to so I can show an “OK” / “Not OK” status on each.
- If there are alerts on all metrics, I can show “Not OK” on them.
- But if there are no alerts, I can’t show “OK” on all - since no alerts (one empty query) means an empty final result.
![]()
If anyone knows some good options or some good joining techniques, any info would be much appreciated,
Thank you