Open thoechsmann opened 4 months ago
Hi @thoechsmann ! The Redshift macro is documented here as having the AS "time"
at the end. Are there other docs you we're looking at that say otherwise? We also could look into adding the macro without the alias if that would be useful.
You are right. I was looking at the MYSQL documentation. My mistake. But it is still confusing that the macros are defined differently.
And I have use cases where I would be very helpful to have the timegroup without alias. This is required whenever you want to do further calculations with the result.
Hi @thomas-calumma ! Thanks for getting back to us, I'll bring this up with the team next week and we'll try to get it in the backlog
What happened?
I am using grafana with a Amazon Redshift sql datesource.
The query
SELECT $__timeGroupAlias(CURRENT_DATE, $__interval)
does not work as$__timeGroupAlias
seems to be unknown. (error executing query: ERROR: syntax error at or near \"$\" Position: 8)The query
SELECT $__timeGroup(CURRENT_DATE, $__interval)
results inSELECT floor(extract(epoch from CURRENT_DATE)/300)*300 AS \"time\"
which is not correct as according to the documentation it should not add the "time" alias.What did you expect to happen?
$__timeGroupAlias
should return what is currently returned by$__timeGroup
$__timeGroup
should not add an aliasDid this work before?
I have not tested in with older Grafana versions.
How do we reproduce it?
Use queries.
Is the bug inside a dashboard panel?
No response
Environment (with versions)?
Grafana: v11.2.0-73451 (a0268a9ad2) OS: Mac Browser: Brave
Grafana platform?
I use Grafana Cloud
Datasource(s)?
Amazon Redshift