davisp commented on a change in pull request #849: Fix external size bug when 
seq btree exists
URL: https://github.com/apache/couchdb/pull/849#discussion_r141918948
 
 

 ##########
 File path: src/couch_mrview/src/couch_mrview_util.erl
 ##########
 @@ -800,7 +800,10 @@ reduced_external_size(Tree) ->
     case couch_btree:full_reduce(Tree) of
         {ok, {_, _, Size}} -> Size;
         % return 0 for versions of the reduce function without Size
-        {ok, {_, _}} -> 0
+        {ok, {_, _}} -> 0;
+        % This is for the case when seq_btree or key_byseq_btree is not
+        % null. Reduces will return an integer.
+        {ok, Size} when is_integer(Size) -> Size
 
 Review comment:
   Ah, no, couch_btree:size is compressed on disk size, not external size. If 
you're doing this for external size calculations you'll have to add that as a 
custom reduce function. You can take a look at the reduce function on existing 
views to get an idea of how it'd work:
   
   
https://github.com/apache/couchdb/blob/master/src/couch_mrview/src/couch_mrview_util.erl#L1054-L1073
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to