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

Method read_rep_levels

parquet/src/column/reader/decoder.rs:426–458  ·  view source on GitHub ↗
(
        &mut self,
        out: &mut Self::Buffer,
        num_records: usize,
        num_levels: usize,
    )

Source from the content-addressed store, hash-verified

424
425impl RepetitionLevelDecoder for RepetitionLevelDecoderImpl {
426 fn read_rep_levels(
427 &mut self,
428 out: &mut Self::Buffer,
429 num_records: usize,
430 num_levels: usize,
431 ) -> Result<(usize, usize)> {
432 let mut total_records_read = 0;
433 let mut total_levels_read = 0;
434
435 while total_records_read < num_records && total_levels_read < num_levels {
436 if self.buffer_len == self.buffer_offset {
437 self.fill_buf()?;
438 if self.buffer_len == 0 {
439 break;
440 }
441 }
442
443 let (partial, records_read, levels_read) = self.count_records(
444 num_records - total_records_read,
445 num_levels - total_levels_read,
446 );
447
448 out.extend_from_slice(
449 &self.buffer[self.buffer_offset..self.buffer_offset + levels_read],
450 );
451
452 total_levels_read += levels_read;
453 total_records_read += records_read;
454 self.buffer_offset += levels_read;
455 self.has_partial = partial;
456 }
457 Ok((total_records_read, total_levels_read))
458 }
459
460 fn skip_rep_levels(&mut self, num_records: usize, num_levels: usize) -> Result<(usize, usize)> {
461 let mut total_records_read = 0;

Callers 2

read_recordsMethod · 0.80
test_skip_rep_levelsFunction · 0.80

Calls 3

count_recordsMethod · 0.80
extend_from_sliceMethod · 0.80
fill_bufMethod · 0.45

Tested by 1

test_skip_rep_levelsFunction · 0.64