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

Function masked_bytes

arrow-select/src/dictionary.rs:360–372  ·  view source on GitHub ↗

Compute [`get_masked_values`] for a [`GenericByteArray`] Note: this does not check the null mask and will return values contained in null slots

(
    array: &'a GenericByteArray<T>,
    mask: &BooleanBuffer,
)

Source from the content-addressed store, hash-verified

358///
359/// Note: this does not check the null mask and will return values contained in null slots
360fn masked_bytes<'a, T: ByteArrayType>(
361 array: &'a GenericByteArray<T>,
362 mask: &BooleanBuffer,
363) -> Vec<(usize, Option<&'a [u8]>)> {
364 let mut out = Vec::with_capacity(mask.count_set_bits());
365 for idx in mask.set_indices() {
366 out.push((
367 idx,
368 array.is_valid(idx).then_some(array.value(idx).as_ref()),
369 ))
370 }
371 out
372}
373
374#[cfg(test)]
375mod tests {

Callers

nothing calls this directly

Calls 6

count_set_bitsMethod · 0.80
set_indicesMethod · 0.80
pushMethod · 0.45
is_validMethod · 0.45
as_refMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected