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

Method union

arrow-buffer/src/buffer/null.rs:79–85  ·  view source on GitHub ↗

Computes the union of the nulls in two optional [`NullBuffer`] This is commonly used by binary operations where the result is NULL if either of the input values is NULL. Handling the null mask separately in this way can yield significant performance improvements over an iterator approach

(lhs: Option<&NullBuffer>, rhs: Option<&NullBuffer>)

Source from the content-addressed store, hash-verified

77 /// of the input values is NULL. Handling the null mask separately in this way
78 /// can yield significant performance improvements over an iterator approach
79 pub fn union(lhs: Option<&NullBuffer>, rhs: Option<&NullBuffer>) -> Option<NullBuffer> {
80 match (lhs, rhs) {
81 (Some(lhs), Some(rhs)) => Some(Self::new(lhs.inner() & rhs.inner())),
82 (Some(n), None) | (None, Some(n)) => Some(n.clone()),
83 (None, None) => None,
84 }
85 }
86
87 /// Computes the union of the nulls in multiple optional [`NullBuffer`]s
88 ///

Callers 1

test_sql.pyFile · 0.45

Calls 2

innerMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected