-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-12287: [C++] Create enumerating generator #9945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…r index as well as whether or not they were the last item in the sequence. This is needed for reassembly potentially out of order record batches during scan.
lidavidm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one typo in the docstring.
cpp/src/arrow/util/async_generator.h
Outdated
|
|
||
| /// Wraps items from a source generator with positional information | ||
| /// | ||
| /// When reqsequencing items from multiple streams that have been merged into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"resequencing"
cpp/src/arrow/util/async_generator.h
Outdated
| /// | ||
| /// Note: Another potential use for this could be resequencing items from a | ||
| /// jittery source. However, the readahead generator will not emit items out of | ||
| /// order today so this is not needed. Furthermore, this generator would need to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is very insightful. Also, the readahead generator isn't the only way of producing items out of order.
cpp/src/arrow/util/async_generator.h
Outdated
| /// order today so this is not needed. Furthermore, this generator would need to | ||
| /// support async reentrancy which, while possible, is not done currently. | ||
| /// | ||
| /// Note: Since this generator is not actually taking in out-of-order sources it isn't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "not actually"? This reads confusing. Are you discussing this implementation or whatever use is made of it inside the code base?
cpp/src/arrow/util/async_generator.h
Outdated
| /// Note: Since this generator is not actually taking in out-of-order sources it isn't | ||
| /// strictly neccesary to add the index, it could be added by a map generator. However, | ||
| /// since this generator is usually used as later input to the sequencing generator and | ||
| /// the sequencing generator needs the index we go ahead and add it for utility's sake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I think sentences like this are confusing. Adding something "for utility's sake" while claiming it's not useful does not make sense.
|
@pitrou I cleaned up the description so it doesn't ramble so much. The "it would be nice if" speculation I put in ARROW-12371. |
|
R failure unrelated, ready for merge/additional review. |
Adds an enumerating generator which tags items with their index as well as whether or not they were the last item in the sequence. This is needed for reassembly potentially out of order record batches during scan.