Support for DUPLICATE_POLICY on TS.CREATE and TS.ADD
filipecosta90 opened this issue · comments
As of RedisTimeseries >= 1.4 You can now add samples to a time series where the time of the sample is older than the newest sample in the series. Bundled with that, we now have a policy that will define handling of duplicate samples, and that needs to be supported on the client via the arguments [DUPLICATE_POLICY policy]
on TS.CREATE
and via [ON_DUPLICATE policy]
on TS.ADD
. The following are the possible policies:
BLOCK
- an error will occur for any out of order sampleFIRST
- ignore the new valueLAST
- override with latest valueMIN
- only override if the value is lower than the existing valueMAX
- only override if the value is higher than the existing value
Further reference: documentation link