Repository navigation
TimeSeries: support multiple aggregators in TS.RANGE/TS.MRANGE (CAE-792) - #4504
Conversation
Extend the existing tsRange/tsRevRange/tsMRange/tsMRevRange family to accept multiple aggregators in a single call, matching the new server syntax `AGGREGATION agg1,agg2,…,aggN bucketDur` (RedisTimeSeries 8.8). Changes: - TSElement: carry `List<Double> values` internally; existing`(long, double)` constructor preserved (wraps in a singleton list); `getValue()` returns `values.get(0)` for backward compatibility; new `getValues()` exposes the full positional list. - TSRangeParams / TSMRangeParams: new `aggregation(AggregationType[],long)` setter; Wire format is identical to the previous single-aggregator output when length == 1. - TimeSeriesBuilderFactory.TIMESERIES_ELEMENT_LIST: parse positional `[ts, v1, …, vN]` samples; size-2 takes the existing single-value path, size > 2 builds a multi-value TSElement. No new public methods on RedisTimeSeriesCommands / RedisTimeSeriesPipelineCommands
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Test Results 191 files ± 0 191 suites ±0 9m 44s ⏱️ -16s Results for commit 23a26e9. ± Comparison against base commit a3d6d95. This pull request removes 14 and adds 30 tests. Note that renamed tests count towards both.This pull request skips 408 tests.♻️ This comment has been updated with latest results. |
- aggregator null check - accidentally commented lines
8222930 to
2ce2dce
Compare
- unmodifiable list
Co-authored-by: Igor Malinovskiy <u.glide@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e60d8a1. Configure here.
| public TSRangeParams aggregation(AggregationType[] aggregators, long bucketDuration) { | ||
| if (aggregators != null) { | ||
| if (aggregators.length == 0) { | ||
| throw new IllegalArgumentException("At least one aggregator is required"); |
There was a problem hiding this comment.
Inconsistent error messages between TSRangeParams and TSMRangeParams
Low Severity
TSRangeParams throws "At least one aggregator is required" for an empty aggregators array, while TSMRangeParams throws "Aggregators must be non-null and non-empty" for the same condition. These two parallel methods perform identical validation but use different wording, making the API inconsistent. The PR discussion explicitly suggested the TSMRangeParams wording as the preferred message.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e60d8a1. Configure here.
…ow-up to #4504) (#4537) * TimeSeries: use singletonList for single-value TSElement (follow-up to #4504) * unused import * TimeSeries: reduce overhead on single-aggregator TSElement path (follow-up to #4504) * TSElement: make equals symmetric across MultiValueTSElement when values match * typo * address review comments - equals/hashcode consistency; --------- Co-authored-by: atakavci <a_takavci@yahoo.com>


Extend the existing tsRange/tsRevRange/tsMRange/tsMRevRange family to accept multiple aggregators in a single call, matching the new server syntax
AGGREGATION agg1,agg2,…,aggN bucketDur(RedisTimeSeries 8.8).Changes:
List<Double> valuesinternally; existing(long, double)constructor preserved (wraps in a singleton list);getValue()returnsvalues.get(0)for backward compatibility; newgetValues()exposes the full positional list.aggregation(AggregationType[],long)setter; Wire format is identical to the previous single-aggregator output when length == 1.[ts, v1, …, vN]samples; size-2 takes the existing single-value path, size > 2 builds a multi-value TSElement.No new public methods on RedisTimeSeriesCommands / RedisTimeSeriesPipelineCommands
Note
Medium Risk
Changes the
TSElementdata model and time series range parameter encoding to support multi-aggregator responses, which may affect equality/hashCode semantics and downstream code that assumes a single value per sample.Overview
Adds support for RedisTimeSeries multi-aggregator syntax (
AGGREGATION a,b,c bucket) acrossTS.RANGE/TS.REVRANGEandTS.MRANGE/TS.MREVRANGEby allowingTSRangeParams/TSMRangeParamsto acceptAggregationType[]and encoding aggregators as a comma-joined token.Updates
TSElementto carry multiple values per timestamp (getValues()), while keepinggetValue()returning the first value for backward compatibility, and extends response parsing to handle[ts, v1, ..., vN]samples.Expands test coverage for wire-format validation and new multi-aggregator behaviors (including empty results) and adjusts cluster time series ITs to disable the new label-based multi-range tests; also updates
pom.xmlformatter includes for timeseries tests.Reviewed by Cursor Bugbot for commit 23a26e9. Bugbot is set up for automated code reviews on this repo. Configure here.