Closed rajeiyer closed 2 years ago
Hi @rajeiyer , thanks for raising the issue.
I'm working on reproducing it, would you be able to confirm that you are using Timestream v1.5.1 and tell me which version of Grafana you are running? Thanks
For future reference, I managed to reproduce with this query:
SELECT measure_name ,
CASE WHEN measure_name = 'task_completed' THEN (SELECT NULL) ELSE time END
FROM $__database.$__table
LIMIT 10
I also pinpointed the issue to https://github.com/grafana/timestream-datasource/blob/main/pkg/timestream/parsers.go#L211-L215
which should be modified as follows :
func datumParserTimestamp(datum *timestreamquery.Datum) (interface{}, error) {
if datum.ScalarValue == nil {
return nil, nil
}
return time.Parse("2006-01-02 15:04:05.99999999", *datum.ScalarValue)
}
I have tested the fix and confirms that it works, I am working on adding tests and will submit a PR for it
@rajeiyer the fix is included in the release 1.5.2 of the plugin if you upgrade you should not have the issue anymore 😃 .
Thank you for the quick turnaround on this issue. Appreciate your help.
The customer that ran into this issue downloaded the latest and verified the fix. Thanks again.
What happened: In a table with both scalar and non-scalar (multi measure) measure values, query
select DemoMetricMultiMeasure6 from "AtlasPDXDevTimestreamDatabase"."dev-mes-multi-measure-test" where measure_name = 'DemoMetric11'
succeeds but queryselect DemoMetricMultiMeasure6 from "AtlasPDXDevTimestreamDatabase"."dev-mes-multi-measure-test"
fails with exceptionMeasure name
DemoMetric11
stores non-scalar values whereDemoMetricMultiMeasure6
is a timestamp field in the non-scalar measure value. There are other measures in the same table with scalar values too. So the second query (without measure name predicate) will return null values forDemoMetricMultiMeasure6
.What you expected to happen: Query should not fail with an exception
How to reproduce it (as minimally and precisely as possible):
Screenshots
Anything else we need to know?:
Environment: