MCPcopy Create free account
hub / github.com/apache/datafusion / scatter_null_mask

Function scatter_null_mask

datafusion/physical-expr-common/src/utils.rs:205–225  ·  view source on GitHub ↗
(
    src_nulls: Option<&NullBuffer>,
    mask: &BooleanBuffer,
    output_len: usize,
    selectivity: f64,
)

Source from the content-addressed store, hash-verified

203}
204
205fn scatter_null_mask(
206 src_nulls: Option<&NullBuffer>,
207 mask: &BooleanBuffer,
208 output_len: usize,
209 selectivity: f64,
210) -> Option<NullBuffer> {
211 let false_count = output_len - mask.count_set_bits();
212 let src_null_count = src_nulls.map(|n| n.null_count()).unwrap_or(0);
213
214 if src_null_count == 0 {
215 if false_count == 0 {
216 None
217 } else {
218 Some(NullBuffer::new(mask.clone()))
219 }
220 } else {
221 let src_nulls = src_nulls.unwrap();
222 let scattered = scatter_bits(src_nulls.inner(), mask, output_len, selectivity);
223 Some(NullBuffer::new(scattered)).filter(|n| n.null_count() > 0)
224 }
225}
226
227fn scatter_primitive<T: ArrowPrimitiveType>(
228 truthy: &PrimitiveArray<T>,

Callers 5

scatter_primitiveFunction · 0.85
scatter_booleanFunction · 0.85
scatter_bytesFunction · 0.85
scatter_byte_viewFunction · 0.85

Calls 7

newFunction · 0.85
scatter_bitsFunction · 0.85
null_countMethod · 0.80
mapMethod · 0.45
cloneMethod · 0.45
innerMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…