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


##########
arrow-ipc/src/reader.rs:
##########
@@ -2235,4 +2237,50 @@ mod tests {
 
         assert_eq!(batch, roundtrip_batch);
     }
+
+    #[test]
+    fn test_invalid_struct_array_ipc_read_errors() {

Review Comment:
   I verified that this test panic's without the code changes in this PR, as 
expected
   
   ```
   ` value: InvalidArgumentError("Incorrect array length for StructArray field 
\"b\", expected 4 got 3")
   stack backtrace:
      0: rust_begin_unwind
                at 
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
      1: core::panicking::panic_fmt
                at 
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
      2: core::result::unwrap_failed
                at 
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1679:5
      3: core::result::Result<T,E>::unwrap
                at 
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1102:23
      4: arrow_array::array::struct_array::StructArray::new
                at 
/Users/andrewlamb/Software/arrow-rs/arrow-array/src/array/struct_array.rs:90:9
      5: <arrow_array::array::struct_array::StructArray as 
core::convert::From<alloc::vec::Vec<(alloc::sync::Arc<arrow_schema::field::Field>,alloc::sync::Arc<dyn
 arrow_array::array::Array>)>>>::from
                at 
/Users/andrewlamb/Software/arrow-rs/arrow-array/src/array/struct_array.rs:401:9
      6: arrow_ipc::reader::create_array
                at ./src/reader.rs:167:17
      7: arrow_ipc::reader::read_record_batch_impl
   
   ```



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