raintank / crate-datasource

Apache License 2.0
13 stars 8 forks source link

Alias at `GROUP BY` field is not used #35

Closed mikethebeer closed 7 years ago

mikethebeer commented 7 years ago

If an alias is set to the group by field, it will be not used in the SQL request.

grafana-metrics

Will be generated in:

SELECT date_trunc('second', current_timestamp) as time, count(*) AS "metric", geohash(coordinates)
FROM "sys"."summits"
WHERE current_timestamp >= ? and current_timestamp <= ?
GROUP BY time, geohash(coordinates)
ORDER BY time, geohash(coordinates) ASC
alexanderzobnin commented 7 years ago

Sorry for confused option. Group By alias works when grafana processes response. It just allows to extract part of returned group by column value using regex:

screenshot from 2017-03-19 21 27 00

Original tag name was house_1