couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [24/50] git commit: User aggregates have binary keys
Date Sat, 18 Jan 2014 00:47:49 GMT
User aggregates have binary keys

BugzID: 14330


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/9444cbe2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/9444cbe2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/9444cbe2

Branch: refs/heads/import
Commit: 9444cbe2471676e68cc650b3f65da13b7d31240f
Parents: ead76ca
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Thu Aug 16 11:10:24 2012 -0400
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Fri Jan 17 16:44:30 2014 -0800

----------------------------------------------------------------------
 src/couch_query_servers.erl | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/9444cbe2/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index fb7f354..eb41e27 100644
--- a/src/couch_query_servers.erl
+++ b/src/couch_query_servers.erl
@@ -236,11 +236,11 @@ builtin_stats(reduce, [[_,First]|Rest]) ->
             {S+V, C+1, erlang:min(Mi,V), erlang:max(Ma,V), Sq+(V*V)};
         ([_K,{PreRed}], {S,C,Mi,Ma,Sq}) when is_list(PreRed) ->
             {
-                S + get_number(sum, PreRed),
-                C + get_number(count, PreRed),
-                erlang:min(get_number(min, PreRed), Mi),
-                erlang:max(get_number(max, PreRed), Ma),
-                Sq + get_number(sumsqr, PreRed)
+                S + get_number(<<"sum">>, PreRed),
+                C + get_number(<<"count">>, PreRed),
+                erlang:min(get_number(<<"min">>, PreRed), Mi),
+                erlang:max(get_number(<<"max">>, PreRed), Ma),
+                Sq + get_number(<<"sumsqr">>, PreRed)
             };
         ([_K,V], _) ->
             Msg = io_lib:format("non-numeric _stats input: ~w", [V]),
@@ -262,11 +262,11 @@ build_initial_accumulator(X) when is_number(X) ->
     {X, 1, X, X, X*X};
 build_initial_accumulator({Props}) ->
     {
-        get_number(sum, Props),
-        get_number(count, Props),
-        get_number(min, Props),
-        get_number(max, Props),
-        get_number(sumsqr, Props)
+        get_number(<<"sum">>, Props),
+        get_number(<<"count">>, Props),
+        get_number(<<"min">>, Props),
+        get_number(<<"max">>, Props),
+        get_number(<<"sumsqr">>, Props)
     };
 build_initial_accumulator(Else) ->
     Msg = io_lib:format("non-numeric _stats input: ~w", [Else]),


Mime
View raw message