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/05/17 13:49:47 UTC

[GitHub] [arrow-rs] HaoYang670 opened a new issue, #1707: `ArrayData::try_new` cannot always return expected error.

HaoYang670 opened a new issue, #1707:
URL: https://github.com/apache/arrow-rs/issues/1707

   Find the bug when working on #911.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   Just do a small change on https://github.com/apache/arrow-rs/blob/master/arrow/src/array/data.rs#L1734-L1750
   Set `null_count` to be `None` instead of `Some(0)`
   ```rust
       #[test]
       #[should_panic(expected = "null_bit_buffer size too small. got 1 needed 2")]
       fn test_bitmap_too_small() {
           let buffer = make_i32_buffer(9);
           let null_bit_buffer = Buffer::from(vec![0b11111111]);
   
           ArrayData::try_new(
               DataType::Int32,
               9,
               None,
               Some(null_bit_buffer),
               0,
               vec![buffer],
               vec![],
           )
           .unwrap();
       }
   ```
   
   This test will panic at `"range end index 2 out of range for slice of length 1"`.
   
   **Expected behavior**
   Panic at `null_bit_buffer size too small. got 1 needed 2`


-- 
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.apache.org

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


[GitHub] [arrow-rs] viirya closed issue #1707: `ArrayData::try_new` cannot always return expected error.

Posted by GitBox <gi...@apache.org>.
viirya closed issue #1707: `ArrayData::try_new` cannot always return expected error.
URL: https://github.com/apache/arrow-rs/issues/1707


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