liamzwbao commented on code in PR #9497:
URL: https://github.com/apache/arrow-rs/pull/9497#discussion_r3019373184


##########
arrow-json/src/reader/list_array.rs:
##########
@@ -91,34 +94,34 @@ impl<O: OffsetSizeTrait, const IS_VIEW: bool> ArrayDecoder 
for ListLikeArrayDeco
             }
 
             let offset = O::from_usize(child_pos.len()).ok_or_else(|| {
-                ArrowError::JsonError(format!("offset overflow decoding {}", 
self.data_type))
+                ArrowError::JsonError(format!("offset overflow decoding 
{}ListArray", O::PREFIX))
             })?;
             offsets.push(offset);
         }
 
-        let child_data = self.decoder.decode(tape, &child_pos)?;
+        let values = self.decoder.decode(tape, &child_pos)?;
         let nulls = nulls.as_mut().map(|x| NullBuffer::new(x.finish()));
 
-        let mut data = ArrayDataBuilder::new(self.data_type.clone())
-            .len(pos.len())
-            .nulls(nulls)
-            .child_data(vec![child_data]);
-
         if IS_VIEW {
             let mut sizes = Vec::with_capacity(offsets.len() - 1);
             for i in 1..offsets.len() {
                 sizes.push(offsets[i] - offsets[i - 1]);
             }
             offsets.pop();
-            data = data
-                .add_buffer(Buffer::from_vec(offsets))
-                .add_buffer(Buffer::from_vec(sizes));
+            let array = GenericListViewArray::<O>::try_new(

Review Comment:
   Revert to use `ArrayDataBuilder` for ListView, will create an issue to 
support `GenericListViewArray::new_unchecked` and improve later



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