MCPcopy Create free account
hub / github.com/apache/arrow-rs / bitwise_bin_op

Method bitwise_bin_op

arrow-array/src/array/boolean_array.rs:441–456  ·  view source on GitHub ↗

Apply a bitwise binary operation to this array and `rhs` using u64 operations, returning a new [`BooleanArray`]. Null buffers are unioned: the result is null where either input is null. See [`BooleanBuffer::from_bitwise_binary_op`] for details on the operation. # Panics Panics if `self` and `rhs` have different lengths. # Example ``` # use arrow_array::BooleanArray; let a = BooleanArray::fro

(&self, rhs: &BooleanArray, op: F)

Source from the content-addressed store, hash-verified

439 /// assert_eq!(result, BooleanArray::from(vec![true, false, false, true]));
440 /// ```
441 pub fn bitwise_bin_op<F>(&self, rhs: &BooleanArray, op: F) -> BooleanArray
442 where
443 F: FnMut(u64, u64) -> u64,
444 {
445 assert_eq!(self.len(), rhs.len());
446 let nulls = NullBuffer::union(self.nulls(), rhs.nulls());
447 let values = BooleanBuffer::from_bitwise_binary_op(
448 self.values.values(),
449 self.values.offset(),
450 rhs.values.values(),
451 rhs.values.offset(),
452 self.values.len(),
453 op,
454 );
455 BooleanArray::new(values, nulls)
456 }
457
458 /// Try to apply a bitwise binary operation to this array and `rhs` in
459 /// place using u64 operations.

Calls 4

nullsMethod · 0.45
valuesMethod · 0.45
offsetMethod · 0.45
lenMethod · 0.45