pgj commented on code in PR #4958:
URL: https://github.com/apache/couchdb/pull/4958#discussion_r1497669690


##########
src/fabric/src/fabric_view_all_docs.erl:
##########
@@ -187,6 +187,49 @@ shards(Db, Args) ->
         end,
     fabric_view:get_shards(Db, NewArgs).
 
+handle_row(Row0, {Worker, _} = Source, State) ->
+    #collector{query_args = Args, counters = Counters0, rows = Rows0} = State,
+    #mrargs{extra = Options, direction = Dir} = Args,
+    Row1 =
+        case Row0 of
+            #view_row{} -> Row0#view_row{worker = Source};
+            #{} -> Row0#{worker => Source}
+        end,
+    % It has to be ensured that rows of the same format are merged in case of
+    % mixed-version cluster scenarios.
+    Row =
+        case couch_util:get_value(execution_stats_rolling, Options, false) of
+            true ->
+                case Row1 of
+                    #view_row{} ->
+                        #{
+                            key => Row1#view_row.key,
+                            id => Row1#view_row.id,
+                            value => Row1#view_row.value,
+                            doc => Row1#view_row.doc,
+                            worker => Row1#view_row.worker,
+                            stats => #{}
+                        };
+                    #{} ->
+                        Row1
+                end;
+            false ->
+                case Row1 of
+                    #view_row{} ->
+                        Row1;
+                    #{} ->
+                        #{id := Id, key := Key} = Row1,
+                        Value = maps:get(value, Row1, null),
+                        Doc = maps:get(doc, Row1, null),
+                        Worker = maps:get(worker, Row1, null),

Review Comment:
   No, that is `undefined`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to