- Newest
- Most votes
- Most comments
For anyone having similar issue. After some investigation I found that the error was being thrown by the CREATE_TIME_SERIES function. It does not allows duplicated time stamps. So I fixed the issue by writing a nested query to first filter out the duplicated timestamps by using group by, Distinct on the time and selecting only of the values for the measure_value. You can use MAX, AVG or MIN function to achieve this. Below is my final query :
WITH DistinctTimeDatePoints AS ( SELECT distinct time, max(measure_value::varchar) as measure_value FROM MITimeStreamDB.Table1 WHERE time BETWEEN '2022-12-1 19:31:20.000000000' AND '2023-01-10 19:31:50.000000000' GROUP BY time ) SELECT INTERPOLATE_LOCF(CREATE_TIME_SERIES(DISTINCT time, measure_value),SEQUENCE(min(time), max(time), 115201s)) AS InterpolatedSeries FROM DistinctTimeDatePoints
Relevant content
- asked 6 months ago
- Accepted Answerasked 3 months ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago