grafana / timestream-datasource

Amazon Timestream in Grafana
https://grafana.com/grafana/plugins/grafana-timestream-datasource
Apache License 2.0
24 stars 19 forks source link

Feature Request: Support for Interval types are missing #65

Closed cpdk closed 3 years ago

cpdk commented 3 years ago

When trying to execute a query that returns an interval an error is returned instead of data.

Example use case: Showing time since last update for a set of sensors

Example query: select measure_name, now() - max(time) as last_update from dbname."tablename" group by measure_name order by measure_name asc

Expected outcome: Table with two columns of results (as in AWS Timestream Console)

Actual outcome: Table with just one column and a message of unsupported data type: "Unsupported scalar value: INTERVAL_DAY_TO_SECOND". This seems to originate from file: parsers.go line: 60 where it is clear that Interval datatypes are not yet supported. An example of how seems to be present in the AWS Developer guide page 79 (https://docs.aws.amazon.com/timestream/latest/developerguide/timestream.pdf)

tiratatp commented 3 years ago

I think this is because Grafana does not support interval in the data frame: https://github.com/grafana/grafana-plugin-sdk-go/blob/master/data/field.go