You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/20 16:55:20 UTC

[GitHub] [arrow-rs] viirya commented on a diff in pull request #1602: Don't access and validate offset buffer in ListArray::from(ArrayData)

viirya commented on code in PR #1602:
URL: https://github.com/apache/arrow-rs/pull/1602#discussion_r854358105


##########
arrow/src/array/array_list.rs:
##########
@@ -524,6 +516,32 @@ mod tests {
         assert_eq!(list_array, another)
     }
 
+    #[test]
+    fn test_empty_list_array() {
+        // Construct an empty value array
+        let value_data = ArrayData::builder(DataType::Int32)
+            .len(0)
+            .add_buffer(Buffer::from_iter(std::iter::empty::<i32>()))

Review Comment:
   Hmm, I don't see C++ ListArray checks first slot in offsets, but it checks the length of offsets:
   
   https://github.com/apache/arrow/blob/c70426f73326b3852d1bd7c31d98be4743f3fcba/cpp/src/arrow/array/array_nested.cc#L111-L113
   
   Seems it requires offsets to have non-zero length?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org