grafana / grafana/redshift-datasource

Add timeGroup macro without alias

Open
#293 3 comments 1 reaction 2 assignees Claimed by @yesoreyeram View on GitHub
datasource/Redshift good first issue prio/low
Dominant language
TypeScript
Stars
19
Forks
10
Avg merge
1d 7h
Merged PRs (30d)
3

Description

### 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 in
`SELECT 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 alias

### Did 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.