Method
set_dict
(
&mut self,
buf: Bytes,
num_values: u32,
encoding: Encoding,
_is_sorted: bool,
)
Source from the content-addressed store, hash-verified
| 150 | } |
| 151 | |
| 152 | fn set_dict( |
| 153 | &mut self, |
| 154 | buf: Bytes, |
| 155 | num_values: u32, |
| 156 | encoding: Encoding, |
| 157 | _is_sorted: bool, |
| 158 | ) -> Result<()> { |
| 159 | if !matches!( |
| 160 | encoding, |
| 161 | Encoding::PLAIN | Encoding::RLE_DICTIONARY | Encoding::PLAIN_DICTIONARY |
| 162 | ) { |
| 163 | return Err(nyi_err!( |
| 164 | "Invalid/Unsupported encoding type for dictionary: {}", |
| 165 | encoding |
| 166 | )); |
| 167 | } |
| 168 | |
| 169 | let num_values = num_values as usize; |
| 170 | let mut buffer = ViewBuffer::with_capacity(num_values); |
| 171 | let mut decoder = |
| 172 | ByteViewArrayDecoderPlain::new(buf, num_values, Some(num_values), self.validate_utf8); |
| 173 | decoder.read(&mut buffer, usize::MAX)?; |
| 174 | self.dict = Some(buffer); |
| 175 | Ok(()) |
| 176 | } |
| 177 | |
| 178 | fn set_data( |
| 179 | &mut self, |