Dataplane: Enable dataplane for results of LongToWide #1057
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Setting the TypeVersion to greater than [0, 0] (along with Meta.Type being set) indicates that the produced
frame follows the dataplane contract (see https://grafana.com/developers/dataplane/ and https://github.com/grafana/dataplane).
Okay, so what will that do?
From a user perspective, there are no expected changes.
Certain datasources call LongWide (In particular, SQL datasources) when the query type in the UI is set to "time series". This sets the output of that call to be "dataplane compliant".
Two consumers will follow a different code path in this case (Server Side Expressions and Recorded Queries). From a user perspective things should change unless there is a bug in those code paths.
In SSE, the fork in the code Path is at:
https://github.com/grafana/grafana/blob/2136fd9a929334f39a371c2127c57b6d83abdf28/pkg/expr/converter.go#L32-L38
Special notes for your reviewer:
Since it is possible there could be an issue with a bug in the code that reads data plane data or something overlooked, I'm thinking through some role out possiblities (they have trade offs):
Options{}
so only done once, but breaking change, so this can be opted into)FrameTypeVersion{0, 1}
back toFrameTypeVersion{0, 0}
after callingLongToWide
.