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

Boolean not kernel does not take offset of null buffer into account #417

Closed
jhorstmann opened this issue Jun 6, 2021 · 0 comments · Fixed by #418
Closed

Boolean not kernel does not take offset of null buffer into account #417

jhorstmann opened this issue Jun 6, 2021 · 0 comments · Fixed by #418
Labels

Comments

@jhorstmann
Copy link
Contributor

Describe the bug
The boolean not kernel does use null_buffer.bits.slice(offset) which takes a byte offset. This leads to wrong results and possible panics if the offset is not equal to 0.

To Reproduce

let a = BooleanArray::from(vec![None, Some(true), Some(false), None, Some(true)]);
let a = a.slice(1, 4);
let a = a.as_any().downcast_ref::<BooleanArray>().unwrap();
let c = not(&a).unwrap();

let expected = BooleanArray::from(vec![Some(false), Some(true), None, Some(false)]);

assert_eq!(c, expected);

Expected behavior
The code should not panic and return the correct result by using the bit_slice method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant