yordan-pavlov commented on a change in pull request #1041:
URL: https://github.com/apache/arrow-rs/pull/1041#discussion_r775164526



##########
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:
       I wonder if `BufferSlice` would be a more fitting name to what this 
method does, e.g.:
   ```
   fn writable_buffer_slice(&mut self, batch_size: usize) -> &mut 
Self::BufferSlice {
   // return writable buffer slice
   }
   ```




-- 
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]


Reply via email to