raghavyadav01 commented on code in PR #14084:
URL: https://github.com/apache/pinot/pull/14084#discussion_r1775790562
##########
pinot-timeseries/pinot-timeseries-spi/src/main/java/org/apache/pinot/tsdb/spi/series/builders/MaxTimeSeriesBuilder.java:
##########
@@ -39,14 +40,15 @@ public MaxTimeSeriesBuilder(String id, TimeBuckets
timeBuckets, List<String> tag
@Override
public void addValueAtIndex(int timeBucketIndex, Double value) {
- if (_values[timeBucketIndex] == null || value > _values[timeBucketIndex]) {
- _values[timeBucketIndex] = value;
+ Double expectedValue = (value == null) ? (Double) 0.0 : value;
+ if (_values[timeBucketIndex] == null || expectedValue >
_values[timeBucketIndex]) {
+ _values[timeBucketIndex] = expectedValue;
}
}
@Override
public void addValue(long timeValue, Double value) {
- int timeBucketIndex = _timeBuckets.resolveIndex(timeValue);
+ int timeBucketIndex =
Objects.requireNonNull(_timeBuckets).resolveIndex(timeValue);
Review Comment:
fixed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]