Method
set_dict
(
&mut self,
buf: Bytes,
num_values: u32,
encoding: Encoding,
_is_sorted: bool,
)
Source from the content-addressed store, hash-verified
| 190 | } |
| 191 | |
| 192 | fn set_dict( |
| 193 | &mut self, |
| 194 | buf: Bytes, |
| 195 | num_values: u32, |
| 196 | encoding: Encoding, |
| 197 | _is_sorted: bool, |
| 198 | ) -> Result<()> { |
| 199 | if !matches!( |
| 200 | encoding, |
| 201 | Encoding::PLAIN | Encoding::RLE_DICTIONARY | Encoding::PLAIN_DICTIONARY |
| 202 | ) { |
| 203 | return Err(nyi_err!( |
| 204 | "Invalid/Unsupported encoding type for dictionary: {}", |
| 205 | encoding |
| 206 | )); |
| 207 | } |
| 208 | |
| 209 | let mut buffer = OffsetBuffer::with_capacity(0); |
| 210 | let mut decoder = ByteArrayDecoderPlain::new( |
| 211 | buf, |
| 212 | num_values as usize, |
| 213 | Some(num_values as usize), |
| 214 | self.validate_utf8, |
| 215 | ); |
| 216 | decoder.read(&mut buffer, usize::MAX)?; |
| 217 | self.dict = Some(buffer); |
| 218 | Ok(()) |
| 219 | } |
| 220 | |
| 221 | fn set_data( |
| 222 | &mut self, |