yezhizi opened a new issue, #3265:
URL: https://github.com/apache/kvrocks/issues/3265

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   When using `TS.GET/TS.RANGE` to query a compacted time series, the `LATEST` 
option can be specified. This causes `TS.GET/TS.RANGE` to return the compacted 
value of the latest bucket, which may be a partial bucket.
   
   Redis reference:
   
[redis.io/docs/latest/commands/ts.create](https://redis.io/docs/latest/commands/ts.create/)
   
   ### Solution
   
   Modify 
[`rangeCommon`](https://github.com/apache/kvrocks/blob/e19164f032b43c9408a5a0badf53aebeb092d97c/src/types/redis_timeseries.h#L318-L319)
 and 
[`getCommon`](https://github.com/apache/kvrocks/blob/e19164f032b43c9408a5a0badf53aebeb092d97c/src/types/redis_timeseries.h#L322-L323)
 to retrieve the latest bucket of source series when the latest sample is 
requested. 
   
   Note: Since partial aggregations are stored in `DOWNSTREAM` sub keys, we 
only need to fetch the last chunk of the source series to retrieve the latest 
bucket's aggregated value.
   
   Refer to [`DOWNSTREAM` sub 
keys](https://kvrocks.apache.org/community/data-structure-on-rocksdb#downstream-sub-keys)
   Refer to https://github.com/apache/kvrocks/pull/3151
   
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to