remove alias from postgres $__timeGroup macro

This commit is contained in:
Sven Klemm
2018-07-30 13:23:29 +02:00
parent f1f0400769
commit 43295f9c18
5 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ func TestMacroEngine(t *testing.T) {
sql, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column,'5m')")
So(err, ShouldBeNil)
So(sql, ShouldEqual, "GROUP BY floor(extract(epoch from time_column)/300)*300 AS time")
So(sql, ShouldEqual, "GROUP BY floor(extract(epoch from time_column)/300)*300")
})
Convey("interpolate __timeGroup function with spaces between args", func() {
@ -61,7 +61,7 @@ func TestMacroEngine(t *testing.T) {
sql, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column , '5m')")
So(err, ShouldBeNil)
So(sql, ShouldEqual, "GROUP BY floor(extract(epoch from time_column)/300)*300 AS time")
So(sql, ShouldEqual, "GROUP BY floor(extract(epoch from time_column)/300)*300")
})
Convey("interpolate __timeTo function", func() {