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

Method decode

arrow-json/src/reader/boolean_array.rs:40–53  ·  view source on GitHub ↗
(&mut self, tape: &Tape<'_>, pos: &[u32])

Source from the content-addressed store, hash-verified

38
39impl ArrayDecoder for BooleanArrayDecoder {
40 fn decode(&mut self, tape: &Tape<'_>, pos: &[u32]) -> Result<ArrayRef, ArrowError> {
41 let mut builder = BooleanBuilder::with_capacity(pos.len());
42 for p in pos {
43 match tape.get(*p) {
44 TapeElement::Null => builder.append_null(),
45 TapeElement::True => builder.append_value(true),
46 TapeElement::False => builder.append_value(false),
47 _ if self.ignore_type_conflicts => builder.append_null(),
48 _ => return Err(tape.error(*p, "boolean")),
49 }
50 }
51
52 Ok(Arc::new(builder.finish()))
53 }
54}

Callers

nothing calls this directly

Calls 6

errorMethod · 0.80
lenMethod · 0.45
getMethod · 0.45
append_nullMethod · 0.45
append_valueMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected