You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2017/03/01 16:38:48 UTC
[50/50] fabric commit: updated refs/heads/2971-count-distinct to
5d18415
Add a finalize step after rereduce
Currently this is a noop for every reduce function except the HLL
cardinately estimator implemented in _distinct.
COUCHDB-2971
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/5d184152
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/5d184152
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/5d184152
Branch: refs/heads/2971-count-distinct
Commit: 5d18415237e7a01e1ac401607f7fc36b671bf640
Parents: d22903c
Author: Adam Kocoloski <ko...@apache.org>
Authored: Thu Apr 28 15:12:44 2016 -0400
Committer: Adam Kocoloski <ko...@apache.org>
Committed: Wed Mar 1 11:35:55 2017 -0500
----------------------------------------------------------------------
src/fabric_view.erl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/5d184152/src/fabric_view.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view.erl b/src/fabric_view.erl
index 45262e4..2c493f3 100644
--- a/src/fabric_view.erl
+++ b/src/fabric_view.erl
@@ -230,8 +230,9 @@ get_next_row(#collector{reducer = RedSrc} = St) when RedSrc =/= undefined ->
end, Counters0, Records),
Wrapped = [[V] || #view_row{value=V} <- Records],
{ok, [Reduced]} = couch_query_servers:rereduce(Lang, [RedSrc], Wrapped),
+ {ok, [Finalized]} = couch_query_servers:finalize([Reduced]),
NewSt = St#collector{keys=RestKeys, rows=NewRowDict, counters=Counters},
- {#view_row{key=Key, id=reduced, value=Reduced}, NewSt};
+ {#view_row{key=Key, id=reduced, value=Finalized}, NewSt};
error ->
get_next_row(St#collector{keys=RestKeys})
end;