(cherry picked from commit 38b030e2a4)
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
This commit is contained in:
co-authored by
Gábor Farkas
parent
d1b02d524c
commit
adfb3d4e21
@@ -167,10 +167,6 @@ func (fb *frameBuilder) Init(metadata *query.FluxTableMetadata) error {
|
||||
dataColumns := getDataColumns(columns)
|
||||
fb.hasUsualStartStop = hasUsualStartStop(dataColumns)
|
||||
|
||||
// first we store the column-info structures as pointers,
|
||||
// because we need to modify some items in the list
|
||||
var columnInfos []*columnInfo
|
||||
|
||||
for _, col := range dataColumns {
|
||||
if col.IsGroup() {
|
||||
fb.labels = append(fb.labels, col.Name())
|
||||
@@ -191,8 +187,6 @@ func (fb *frameBuilder) Init(metadata *query.FluxTableMetadata) error {
|
||||
isTheSingleValue: false,
|
||||
}
|
||||
|
||||
columnInfos = append(columnInfos, info)
|
||||
|
||||
if isTimestamp {
|
||||
timestampCols = append(timestampCols, info)
|
||||
} else {
|
||||
@@ -216,7 +210,12 @@ func (fb *frameBuilder) Init(metadata *query.FluxTableMetadata) error {
|
||||
nonTimestampCols[0].isTheSingleValue = true
|
||||
}
|
||||
|
||||
for _, colInfo := range columnInfos {
|
||||
// grafana wants the timestamp columns first, so we add them first
|
||||
for _, colInfo := range timestampCols {
|
||||
fb.columns = append(fb.columns, *colInfo)
|
||||
}
|
||||
// then we add the non-timestamp-columns
|
||||
for _, colInfo := range nonTimestampCols {
|
||||
fb.columns = append(fb.columns, *colInfo)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user