SSE: Add noData type (#51973)

When there is a single frame with no fields (e.g. splunk datasource) SSE errors when trying to figure out the data type. This frame needs to exist since this is where the executedQueryString metadata exists.

This adds a new return type to SSE to represent no data, so the original frame with its metadata can still be maintained.
This commit is contained in:
Kyle Brandt
2022-07-14 09:18:12 -04:00
committed by GitHub
parent 5d199a40b7
commit 05fd7eb047
5 changed files with 88 additions and 2 deletions
+26
View File
@@ -79,6 +79,32 @@ func Test_union(t *testing.T) {
unionsAre: assert.EqualValues,
unions: []*Union{},
},
{
name: "empty result and data result will result in no unions",
aResults: Results{
Values: Values{
makeSeries("a", data.Labels{"id": "1"}),
},
},
bResults: Results{},
unionsAre: assert.EqualValues,
unions: []*Union{},
},
{
name: "no data result and data result will result in no unions",
aResults: Results{
Values: Values{
makeSeries("a", data.Labels{"id": "1"}),
},
},
bResults: Results{
Values: Values{
NoData{}.New(),
},
},
unionsAre: assert.EqualValues,
unions: []*Union{},
},
{
name: "incompatible tags of different length with will result in no unions when len(A) != 1 && len(B) != 1",
aResults: Results{