rtpsw commented on code in PR #34392:
URL: https://github.com/apache/arrow/pull/34392#discussion_r1185371263
##########
cpp/src/arrow/chunked_array.h:
##########
@@ -263,8 +263,10 @@ Status ApplyBinaryChunked(const ChunkedArray& left, const
ChunkedArray& right,
Action&& action) {
MultipleChunkIterator iterator(left, right);
std::shared_ptr<Array> left_piece, right_piece;
+ int64_t pos = iterator.position();
while (iterator.Next(&left_piece, &right_piece)) {
- ARROW_RETURN_NOT_OK(action(*left_piece, *right_piece,
iterator.position()));
+ ARROW_RETURN_NOT_OK(action(*left_piece, *right_piece, pos));
+ pos = iterator.position();
Review Comment:
The pre-PR code reads `iterator.position()` after it is advanced, so the
action gets a 1-based column index, which is incorrect per [the documentation
comments](https://github.com/apache/arrow/blob/febd0ff144cfb8b2baffb1cb0be57ca40dc7cc77/cpp/src/arrow/chunked_array.h#L239-L260).
In the investigation here, this index ended up in the messages and got me
confused until I discovered this.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]