Repository: trafodion Updated Branches: refs/heads/master 703e96391 -> 7b96645a4
[TRAFODION-2965] Fix row count stats for partial groupby Hash partial groupbys now report their row count in operator-level statistics. These are not considered BMOs, so they need to use the generic stats entry, not the BMO stats, to report the row count. Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/39a3f204 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/39a3f204 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/39a3f204 Branch: refs/heads/master Commit: 39a3f2047a847768ddcc84b7a549eb322b7b4c48 Parents: 81db5c0 Author: Hans Zeller <[email protected]> Authored: Wed Feb 21 18:23:20 2018 +0000 Committer: Hans Zeller <[email protected]> Committed: Wed Feb 21 18:23:20 2018 +0000 ---------------------------------------------------------------------- core/sql/executor/ex_hash_grby.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/39a3f204/core/sql/executor/ex_hash_grby.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ex_hash_grby.cpp b/core/sql/executor/ex_hash_grby.cpp index 4c07b60..e0835b9 100644 --- a/core/sql/executor/ex_hash_grby.cpp +++ b/core/sql/executor/ex_hash_grby.cpp @@ -1027,8 +1027,10 @@ void ex_hash_grby_tcb::returnResultCurrentRow(HashRow * dataPointer) upParentEntry->upState.downIndex = parentQueue_.down->getHeadIndex(); // if stats are to be collected, collect them. - if (bmoStats_) - bmoStats_->incActualRowsReturned(); + ExOperStats *statsEntry = getStatsEntry(); + + if (statsEntry) + statsEntry->incActualRowsReturned(); if (hashGroupByStats_) hashGroupByStats_->incPartialGroupsReturned(); @@ -1774,7 +1776,7 @@ void ex_hash_grby_tcb::workEvaluate() { ///////////////////////////////////////////////////////////////////////////// ULng32 ex_hash_grby_tcb::workReturnRows(NABoolean tryToDefrag) { HashRow * dataPointer = NULL; - + ExOperStats *statsEntry = getStatsEntry(); ex_queue_entry * downParentEntry = parentQueue_.down->getHeadEntry(); // If we are returning rows from the bitmux buffer, then search through @@ -1879,8 +1881,8 @@ ULng32 ex_hash_grby_tcb::workReturnRows(NABoolean tryToDefrag) { // if stats are to be collected, collect them. - if (bmoStats_) { - bmoStats_->incActualRowsReturned(); + if (statsEntry) { + statsEntry->incActualRowsReturned(); } upParentEntry->upState.status = ex_queue::Q_OK_MMORE;
