westonpace commented on a change in pull request #9945:
URL: https://github.com/apache/arrow/pull/9945#discussion_r609930251



##########
File path: cpp/src/arrow/util/async_generator.h
##########
@@ -1063,6 +1063,86 @@ AsyncGenerator<T> 
MakeConcatenatedGenerator(AsyncGenerator<AsyncGenerator<T>> so
   return MergedGenerator<T>(std::move(source), 1);
 }
 
+template <typename T>
+struct Enumerated {
+  util::optional<T> value;
+  int index;
+  bool last;

Review comment:
       The need for this originated from trying to resequence merged streams.  
So given a generator that returns streams (A, B, C), each of which return items 
(1, 2), the merged generator might return something like...
   
   ```
   A1
   B1
   A2
   C1
   C2
   B2
   ```
   
   Any end tokens are removed by the merge operation.  Otherwise the combined 
stream would terminate after A2.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to