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

Method set_dict

parquet/src/arrow/array_reader/byte_array.rs:192–219  ·  view source on GitHub ↗
(
        &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,

Callers 3

test_byte_array_decoderFunction · 0.45

Calls 1

readMethod · 0.45

Tested by 3

test_byte_array_decoderFunction · 0.36