Skip to content

Commit

Permalink
Merge pull request #358 from akumuli/fix357-group-aggregate
Browse files Browse the repository at this point in the history
Fix group-aggregate inconsistency
  • Loading branch information
Lazin authored May 19, 2020
2 parents f3da106 + 741aef3 commit c0803be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Release notes
=============

Version 0.8.80
--------------

BUG FIX

* Fix #357 group-aggreagate query in backward direction returns
invalid first/last values

Version 0.8.79
--------------

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)

set(APP_VERSION_MAJOR "0")
set(APP_VERSION_MINOR "8")
set(APP_VERSION_PATCH "79")
set(APP_VERSION_PATCH "80")
string(TIMESTAMP APP_COMPILATION_TIME "%Y%m%d")

set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}")
Expand Down
8 changes: 4 additions & 4 deletions libakumuli/storage_engine/operators/operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ void AggregationResult::add(aku_Timestamp ts, double xs, bool forward) {
maxts = ts;
}
if (cnt == 0) {
first = xs;
if (forward) {
first = xs;
_begin = ts;
} else {
last = xs;
_end = ts;
}
}
last = xs;
if (forward) {
last = xs;
_end = ts;
} else {
first = xs;
_begin = ts;
}
cnt += 1;
Expand All @@ -83,8 +85,6 @@ void AggregationResult::combine(const AggregationResult& other) {
max = other.max;
maxts = other.maxts;
}
min = std::min(min, other.min);
max = std::max(max, other.max);
if (_begin > other._begin) {
first = other.first;
_begin = other._begin;
Expand Down

0 comments on commit c0803be

Please sign in to comment.