Anakin100100 commented on code in PR #49375:
URL: https://github.com/apache/arrow/pull/49375#discussion_r2867187129
##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -745,18 +760,22 @@ struct IfElseFunctor<Type, enable_if_base_binary<Type>> {
ARROW_ASSIGN_OR_RAISE(out_data->buffers[1],
ctx->Allocate(offset_length));
std::memcpy(out_data->buffers[1]->mutable_data(), right_offsets,
offset_length);
- auto right_data_length = right_offsets[right.length] - right_offsets[0];
+ int64_t right_data_length =
static_cast<int64_t>(right_offsets[right.length]) -
+ static_cast<int64_t>(right_offsets[0]);
+ ARROW_RETURN_NOT_OK(ValidateCapacityForOffsetType(right_data_length));
Review Comment:
Yeah, if the array Already holds 2GB then assigning from the scalar won't
overflow,
--
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]