MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / build_null_buffer

Function build_null_buffer

nodedb-strict/src/arrow_extract.rs:75–93  ·  view source on GitHub ↗

Build a NullBuffer from the null bitmap of N tuples for a given column.

(
    decoder: &TupleDecoder,
    tuples: &[&[u8]],
    col_idx: usize,
)

Source from the content-addressed store, hash-verified

73
74/// Build a NullBuffer from the null bitmap of N tuples for a given column.
75fn build_null_buffer(
76 decoder: &TupleDecoder,
77 tuples: &[&[u8]],
78 col_idx: usize,
79) -> Result<(NullBuffer, usize), StrictError> {
80 let n = tuples.len();
81 let mut validity = Vec::with_capacity(n);
82 let mut null_count = 0;
83
84 for tuple in tuples {
85 let is_null = decoder.is_null(tuple, col_idx)?;
86 validity.push(!is_null);
87 if is_null {
88 null_count += 1;
89 }
90 }
91
92 Ok((NullBuffer::new(BooleanBuffer::from(validity)), null_count))
93}
94
95fn extract_int64(
96 decoder: &TupleDecoder,

Callers 9

extract_int64Function · 0.85
extract_float64Function · 0.85
extract_boolFunction · 0.85
extract_timestampFunction · 0.85
extract_stringFunction · 0.85
extract_binaryFunction · 0.85
extract_uuidFunction · 0.85
extract_vectorFunction · 0.85

Calls 3

lenMethod · 0.45
is_nullMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected