mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SQL Datasources: Allow multiple string/labels columns with time series (#36485)
for #36370
This commit is contained in:
parent
aa3a46272f
commit
3ab9249f16
@ -173,7 +173,7 @@ func (e *dataPlugin) DataQuery(ctx context.Context, dsInfo *models.DataSource,
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: staticcheck // plugins.DataQueryResult deprecated
|
//nolint: staticcheck,gocyclo // plugins.DataQueryResult deprecated
|
||||||
func (e *dataPlugin) executeQuery(query plugins.DataSubQuery, wg *sync.WaitGroup, queryContext plugins.DataQuery,
|
func (e *dataPlugin) executeQuery(query plugins.DataSubQuery, wg *sync.WaitGroup, queryContext plugins.DataQuery,
|
||||||
ch chan plugins.DataQueryResult) {
|
ch chan plugins.DataQueryResult) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
@ -292,6 +292,10 @@ func (e *dataPlugin) executeQuery(query plugins.DataSubQuery, wg *sync.WaitGroup
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if t := frame.Fields[i].Type(); t == data.FieldTypeString || t == data.FieldTypeNullableString {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
if frame, err = convertSQLValueColumnToFloat(frame, i); err != nil {
|
if frame, err = convertSQLValueColumnToFloat(frame, i); err != nil {
|
||||||
errAppendDebug("convert value to float failed", err, interpolatedQuery)
|
errAppendDebug("convert value to float failed", err, interpolatedQuery)
|
||||||
@ -892,7 +896,7 @@ func convertSQLValueColumnToFloat(frame *data.Frame, Index int) (*data.Frame, er
|
|||||||
default:
|
default:
|
||||||
convertUnknownToZero(frame.Fields[Index], newField)
|
convertUnknownToZero(frame.Fields[Index], newField)
|
||||||
frame.Fields[Index] = newField
|
frame.Fields[Index] = newField
|
||||||
return frame, fmt.Errorf("metricIndex %d type can't be converted to float", Index)
|
return frame, fmt.Errorf("metricIndex %d type %s can't be converted to float", Index, valueType)
|
||||||
}
|
}
|
||||||
frame.Fields[Index] = newField
|
frame.Fields[Index] = newField
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user