You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2020/09/29 20:38:56 UTC

[couchdb] branch fdb-btree-reduce-davisp created (now ecb067b)

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a change to branch fdb-btree-reduce-davisp
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at ecb067b  Use JSON collation

This branch includes the following new commits:

     new ecb067b  Use JSON collation

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Use JSON collation

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch fdb-btree-reduce-davisp
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit ecb067ba1a2b32a1d6a5a210d496664adedd55ce
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Sep 29 09:56:19 2020 -0500

    Use JSON collation
---
 src/couch_views/src/couch_views_reduce_fdb.erl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/couch_views/src/couch_views_reduce_fdb.erl b/src/couch_views/src/couch_views_reduce_fdb.erl
index a5cb905..8ea2061 100644
--- a/src/couch_views/src/couch_views_reduce_fdb.erl
+++ b/src/couch_views/src/couch_views_reduce_fdb.erl
@@ -193,11 +193,18 @@ open_tree(TxDb, Sig, ViewId, ViewReduceFun) ->
 
     TreeOpts = [
         {reduce_fun, get_reducer(ViewReduceFun)},
+        {collate_fun, fun less_json_rows/2},
         {encode_fun, EncodeFun}
     ],
     ebtree:open(Tx, ReduceIdxPrefix, btree_order_size(), TreeOpts).
 
 
+less_json_rows({_, _} = A, {_, _} = B) ->
+    couch_ejson_compare:less_json_ids(A, B);
+less_json_rows(A, B) ->
+    couch_ejson_compare:less_json(A, B).
+
+
 delete_keys(Tx, Tree, DocId, Keys) ->
     lists:foreach(fun (Key) ->
         EK = create_key(Key, DocId),