viirya commented on code in PR #3144:
URL: https://github.com/apache/arrow-rs/pull/3144#discussion_r1033858729
##########
arrow/src/compute/kernels/arity.rs:
##########
@@ -205,6 +205,75 @@ where
Ok(unsafe { build_primitive_array(len, buffer, null_count, null_buffer) })
}
+/// Given two arrays of length `len`, calls `op(a[i], b[i])` for `i` in
`0..len`, mutating
+/// the mutable [`PrimitiveArray`] `a`. If any index is null in either `a` or
`b`, the
+/// corresponding index in the result will also be null.
+///
+/// Mutable primitive array means that the buffer is not shared with other
arrays.
+/// As a result, this mutates the buffer directly without allocating new
buffer.
+///
+/// Like [`unary`] the provided function is evaluated for every index,
ignoring validity. This
+/// is beneficial when the cost of the operation is low compared to the cost
of branching, and
+/// especially when the operation can be vectorised, however, requires `op` to
be infallible
+/// for all possible values of its inputs
+///
+/// # Error
+///
+/// This function gives error if the arrays have different lengths.
+/// This function gives error of original [`PrimitiveArray`] `a` if it is not
a mutable
+/// primitive array.
+pub fn binary_mut<T, F>(
Review Comment:
Similarly, I will leave this only and remove `_mut` kernels.
--
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]