Postgres: Fix timeGroup macro converts long intervals to invalid numbers when TimescaleDB is enabled (#31179)

Fixes #27253
This commit is contained in:
Ricky Putra
2021-02-16 00:15:57 +08:00
committed by GitHub
parent 9c08b34e71
commit d56c5285e2
2 changed files with 8 additions and 1 deletions

View File

@ -107,7 +107,7 @@ func (m *postgresMacroEngine) evaluateMacro(name string, args []string) (string,
}
if m.timescaledb {
return fmt.Sprintf("time_bucket('%vs',%s)", interval.Seconds(), args[0]), nil
return fmt.Sprintf("time_bucket('%.0fs',%s)", interval.Seconds(), args[0]), nil
}
return fmt.Sprintf(