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

Function encode_f64_with_validity

nodedb-columnar/src/writer/encode.rs:21–28  ·  view source on GitHub ↗

Encode f64 values with a prepended validity bitmap.

(
    values: &[f64],
    valid: &[bool],
    codec: ResolvedColumnCodec,
)

Source from the content-addressed store, hash-verified

19
20/// Encode f64 values with a prepended validity bitmap.
21pub(super) fn encode_f64_with_validity(
22 values: &[f64],
23 valid: &[bool],
24 codec: ResolvedColumnCodec,
25) -> Result<Vec<u8>, ColumnarError> {
26 let compressed = encode_f64_pipeline(values, codec.into_column_codec())?;
27 Ok(prepend_validity(valid, &compressed))
28}
29
30/// Encode a validity bitmap: ceil(N/8) bytes, bit=0 means null, bit=1 means valid.
31pub(super) fn encode_validity_bitmap(valid: &[bool]) -> Vec<u8> {

Callers 1

encode_single_blockFunction · 0.85

Calls 3

encode_f64_pipelineFunction · 0.85
prepend_validityFunction · 0.85
into_column_codecMethod · 0.80

Tested by

no test coverage detected