tustvold commented on a change in pull request #1041:
URL: https://github.com/apache/arrow-rs/pull/1041#discussion_r776332615
##########
File path: parquet/src/arrow/record_reader/definition_levels.rs
##########
@@ -0,0 +1,82 @@
+use arrow::array::BooleanBufferBuilder;
+use arrow::bitmap::Bitmap;
+use arrow::buffer::Buffer;
+use std::ops::Range;
+
+use crate::column::reader::decoder::ColumnLevelDecoderImpl;
+use crate::schema::types::ColumnDescPtr;
+
+use super::{
+ buffer::{RecordBuffer, TypedBuffer},
+ MIN_BATCH_SIZE,
+};
+
+pub struct DefinitionLevelBuffer {
+ buffer: TypedBuffer<i16>,
+ builder: BooleanBufferBuilder,
+ max_level: i16,
+}
+
+impl RecordBuffer for DefinitionLevelBuffer {
+ type Output = Buffer;
+ type Writer = [i16];
+
+ fn split(&mut self, len: usize) -> Self::Output {
+ self.buffer.split(len)
+ }
+
+ fn writer(&mut self, batch_size: usize) -> &mut Self::Writer {
Review comment:
Yeah, I'm not a fan of this method's name. It gets confusing because the
optimized implementations in #1054 and #1082 don't use this method to yield a
slice at all, I need to think more on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]