SQL Expressions: Change metric conversion to full long (#102728)

When querying metric data (non-table data) with SQL Expressions, we need to convert the data to table format. This is alternative format which does not have the same issues with sparse data.

There is now a __metric_name__ column and one __value__ column. Also a __display_name__ column if there is DisplayNameFromDS metadata.

---------

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
This commit is contained in:
Kyle Brandt
2025-03-24 22:04:43 +02:00
committed by GitHub
co-authored by Adam Simpson
parent 5dd0aa2c73
commit f4849eabc7
16 changed files with 1613 additions and 372 deletions
+1 -1
View File
@@ -429,7 +429,7 @@ func (dn *DSNode) Execute(ctx context.Context, now time.Time, _ mathexp.Vars, s
}
if needsConversion {
convertedFrames, err := ConvertToLong(dataFrames)
convertedFrames, err := ConvertToFullLong(dataFrames)
if err != nil {
return result, fmt.Errorf("failed to convert data frames to long format for sql: %w", err)
}