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

Function selection_mask

arrow-array/src/array/union_array.rs:1024–1032  ·  view source on GitHub ↗
(type_ids_chunk: &[i8], type_id: i8)

Source from the content-addressed store, hash-verified

1022}
1023
1024fn selection_mask(type_ids_chunk: &[i8], type_id: i8) -> u64 {
1025 type_ids_chunk
1026 .iter()
1027 .copied()
1028 .enumerate()
1029 .fold(0, |packed, (bit_idx, v)| {
1030 packed | (((v == type_id) as u64) << bit_idx)
1031 })
1032}
1033
1034/// Returns a bitmask where bits indicate if any id from `without_nulls_ids` exist in `type_ids_chunk`.
1035fn without_nulls_selected(type_ids_chunk: &[i8], without_nulls_ids: &[i8]) -> u64 {

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected