Add test of InfluxQL parsing with aggregates and aliases
parent
312e74993f
commit
2c3c9f39cc
|
@ -629,6 +629,31 @@ func TestConvert(t *testing.T) {
|
||||||
AreTagsAccepted: false,
|
AreTagsAccepted: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "count with aggregate",
|
||||||
|
influxQL: `SELECT COUNT(water) as "count_water" FROM "h2o_feet"`,
|
||||||
|
want: chronograf.QueryConfig{
|
||||||
|
Measurement: "h2o_feet",
|
||||||
|
Fields: []chronograf.Field{
|
||||||
|
chronograf.Field{
|
||||||
|
Value: "count",
|
||||||
|
Type: "func",
|
||||||
|
Alias: "count_water",
|
||||||
|
Args: []chronograf.Field{
|
||||||
|
{
|
||||||
|
Value: "water",
|
||||||
|
Type: "field",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
GroupBy: chronograf.GroupBy{
|
||||||
|
Tags: []string{},
|
||||||
|
},
|
||||||
|
Tags: map[string][]string{},
|
||||||
|
AreTagsAccepted: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "count of a wildcard",
|
name: "count of a wildcard",
|
||||||
influxQL: ` SELECT COUNT(*) FROM "h2o_feet"`,
|
influxQL: ` SELECT COUNT(*) FROM "h2o_feet"`,
|
||||||
|
|
Loading…
Reference in New Issue