Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final slicing in combine_option_bitmap needs to use bit slices #1899

Closed
jhorstmann opened this issue Jun 17, 2022 · 0 comments · Fixed by #1900
Closed

Final slicing in combine_option_bitmap needs to use bit slices #1899

jhorstmann opened this issue Jun 17, 2022 · 0 comments · Fixed by #1900
Labels
arrow Changes to the arrow crate bug

Comments

@jhorstmann
Copy link
Contributor

jhorstmann commented Jun 17, 2022

Describe the bug

In combine_option_bitmap the buffer is sliced using Buffer::slice. Since this function is dealing with bitwise validity buffers, it needs to use Buffer::bit_slice instead.

To Reproduce

    #[test]
    fn test_combine_option_bitmap_with_offsets() {
        let bitmap1 =
            make_data_with_null_bit_buffer(8, 1, Some(Buffer::from([0b01010100, 0b1])));
        assert_eq!(
            Some(Buffer::from([0b10101010])),
            combine_option_bitmap(&[&bitmap1], 8).unwrap()
        );
    }

Expected behavior

The above testcase should pass.

Additional context

Bug was probably introduced the combine_option_bitmap was extended to support arbitrarily many buffers.

@jhorstmann jhorstmann added the bug label Jun 17, 2022
@alamb alamb changed the title Final slicing in combine_option_bitmap needs to use bit slices Final slicing in combine_option_bitmap needs to use bit slices Jun 23, 2022
@alamb alamb added the arrow Changes to the arrow crate label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants