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

Method read_dictionary

arrow-ipc/src/reader.rs:1093–1112  ·  view source on GitHub ↗

Read the dictionary with the given block and data buffer

(&mut self, block: &Block, buf: &Buffer)

Source from the content-addressed store, hash-verified

1091
1092 /// Read the dictionary with the given block and data buffer
1093 pub fn read_dictionary(&mut self, block: &Block, buf: &Buffer) -> Result<(), ArrowError> {
1094 let message = self.read_message(buf)?;
1095 match message.header_type() {
1096 crate::MessageHeader::DictionaryBatch => {
1097 let batch = message.header_as_dictionary_batch().unwrap();
1098 read_dictionary_impl(
1099 &buf.slice(block.metaDataLength() as _),
1100 batch,
1101 &self.schema,
1102 &mut self.dictionaries,
1103 &message.version(),
1104 self.require_alignment,
1105 self.skip_validation.clone(),
1106 )
1107 }
1108 t => Err(ArrowError::ParseError(format!(
1109 "Expecting DictionaryBatch in dictionary blocks, found {t:?}."
1110 ))),
1111 }
1112 }
1113
1114 /// Read the RecordBatch with the given block and data buffer
1115 pub fn read_record_batch(

Callers 4

newMethod · 0.80
newMethod · 0.80
buildMethod · 0.80

Calls 8

read_dictionary_implFunction · 0.85
read_messageMethod · 0.80
header_typeMethod · 0.80
metaDataLengthMethod · 0.80
sliceMethod · 0.45
versionMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected