1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
-1
To get the most recent entry from an Amazon Timestream table, you can use a query that includes an ORDER BY clause and LIMIT 1 to fetch only the top (most recent) result.
see this as an example , The following gets the 10 most recently added data points for a table. (https://docs.aws.amazon.com/timestream/latest/developerguide/sample-queries.basic-scenarios.html)
SELECT * FROM <database_name>.<table_name>
ORDER BY time DESC
LIMIT 10
Yes , you can try to extend the solution to include a query with aggregation and grouping in Amazon Timestream but may be you have to extract the results and process the results as needed.
Conteúdo relevante
- AWS OFICIALAtualizada há 2 meses
- AWS OFICIALAtualizada há 2 anos
This approach, as I mentioned in my original post (though there was a typo, corrected now), still needs to scan the entire table to retrieve that result. Since there is an index on time, I'd expect there to be a way to query the latest row without scanning the entire table.