Read the dictionary with the given block and data buffer
(&mut self, block: &Block, buf: &Buffer)
| 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( |
no test coverage detected