alamb commented on code in PR #9715:
URL: https://github.com/apache/arrow-rs/pull/9715#discussion_r3118248850


##########
arrow-json/src/reader/list_array.rs:
##########
@@ -134,3 +136,86 @@ impl<O: OffsetSizeTrait, const IS_VIEW: bool> ArrayDecoder 
for ListLikeArrayDeco
         }
     }
 }
+
+pub struct FixedSizeListArrayDecoder {
+    field: FieldRef,
+    size: i32,
+    decoder: Box<dyn ArrayDecoder>,
+    ignore_type_conflicts: bool,
+    is_nullable: bool,
+}
+
+impl FixedSizeListArrayDecoder {
+    pub fn new(
+        ctx: &DecoderContext,
+        data_type: &DataType,
+        is_nullable: bool,
+    ) -> Result<Self, ArrowError> {
+        let (field, size) = match data_type {
+            DataType::FixedSizeList(f, s) => (f, *s),
+            _ => unreachable!(),
+        };
+        let decoder = ctx.make_decoder(field.data_type(), 
field.is_nullable())?;
+
+        Ok(Self {
+            field: field.clone(),
+            size,
+            decoder,
+            ignore_type_conflicts: ctx.ignore_type_conflicts(),
+            is_nullable,
+        })
+    }
+}
+
+impl ArrayDecoder for FixedSizeListArrayDecoder {
+    fn decode(&mut self, tape: &Tape<'_>, pos: &[u32]) -> Result<ArrayRef, 
ArrowError> {
+        let expected = self.size as usize;
+        let mut child_pos = Vec::with_capacity(pos.len() * expected);
+
+        let mut nulls = self
+            .is_nullable
+            .then(|| BooleanBufferBuilder::new(pos.len()));

Review Comment:
   Filed  a ticket to track
   - https://github.com/apache/arrow-rs/issues/9781



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