garrensmith commented on a change in pull request #1656: Partition review fixes
URL: https://github.com/apache/couchdb/pull/1656#discussion_r226233178
##########
File path: src/fabric/src/fabric_view_all_docs.erl
##########
@@ -148,16 +154,16 @@ shards(DbName, Args) ->
{_, _} ->
mem3:shards(DbName)
end;
- _ ->
- mem3:shards(DbName)
+ {true, Partition} ->
+ mem3:shards(DbName, <<Partition/binary, ":foo">>)
end.
-partition(undefined) ->
- undefined;
-partition(null) ->
- null;
+
partition(Key) when is_binary(Key) ->
- hd(binary:split(Key, <<":">>)).
+ hd(binary:split(Key, <<":">>));
+partition(_) ->
+ undefined.
Review comment:
Not always. Mango can pass through a number. So I'm assuming we could pass
through somethings that are not binary. So I prefer to not be so explicit. That
function is just looking for the possibility that the key is a binary that
could a have a partition key, otherwise, it really doesn't care.
----------------------------------------------------------------
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