diff --git a/pkg/druid.go b/pkg/druid.go index 953e883..55f08ba 100644 --- a/pkg/druid.go +++ b/pkg/druid.go @@ -517,6 +517,14 @@ func (ds *druidDatasource) executeQuery(queryRef string, q druidquerybuilder.Que Type string }{Name: c.(string)} detectColumnType(&col, i, r.Rows) + // len of sqlr > 1, we can infer string and number types from the data row (string is in "quotes") also, time is also in string format + switch sqlr[1].([]interface{})[i].(type) { + case string: + if col.Type != "time" && col.Type != "bool" { + // if the data type is string and not detected as time or bool, keep it as string + col.Type = "string" + } + } r.Columns = append(r.Columns, col) } }