Skip to content

Commit 59cfc07

Browse files
Minor grafadruid fixes (#51)
1 parent e424d9b commit 59cfc07

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

pkg/tsdb/druid/druid.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,9 @@ func (ds *Service) prepareQuery(qry []byte, s *druidInstanceSettings) (druidquer
451451

452452
func (ds *Service) prepareQueryContext(parameters []interface{}) map[string]interface{} {
453453
ctx := make(map[string]interface{})
454-
if parameters != nil {
455-
for _, parameter := range parameters {
456-
p := parameter.(map[string]interface{})
457-
ctx[p["name"].(string)] = p["value"]
458-
}
454+
for _, parameter := range parameters {
455+
p := parameter.(map[string]interface{})
456+
ctx[p["name"].(string)] = p["value"]
459457
}
460458
return ctx
461459
}

pkg/tsdb/druid/result/common.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package result
22

33
import (
4+
"fmt"
45
"time"
56

67
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
@@ -75,7 +76,7 @@ func toTypedResults(raw []interface{}) interface{} {
7576
return results
7677
default:
7778
// TODO better error handling
78-
log.DefaultLogger.Debug("Unsupported value %T", raw[0])
79+
log.DefaultLogger.Debug(fmt.Sprintf("Unsupported type %T", raw[0]))
7980
return nil
8081
}
8182
}

pkg/tsdb/druid/result/timeseries.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type TimeseriesRecord struct {
4747
}
4848

4949
// Columns returns list of columns for given record.
50-
// The first column will always be "timestamp" followed by other columns sorter
50+
// The first column will always be "timestamp" followed by other columns sorted
5151
// alphabetically.
5252
func (t *TimeseriesRecord) Columns() []string {
5353
columns := make([]string, len(t.Result)+1)

0 commit comments

Comments
 (0)