-
Notifications
You must be signed in to change notification settings - Fork 867
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
Fix IPCWriter for Sliced BooleanArray #3498
Conversation
Fixes apache#3496.
arrow-ipc/src/writer.rs
Outdated
// Bools are special because the payload (= 1 bit) is smaller than the physical container elements (= bytes). | ||
// The array data may not start at the physical boundary of the underlying buffer, so we need to shift bits around. | ||
assert!(array_data.buffers().len() == 1); | ||
let buffer = &array_data.buffers()[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use Buffer::bit_slice here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice, didn't know that this existed. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor nit
arrow-ipc/src/writer.rs
Outdated
} else if matches!(data_type, DataType::Boolean) { | ||
// Bools are special because the payload (= 1 bit) is smaller than the physical container elements (= bytes). | ||
// The array data may not start at the physical boundary of the underlying buffer, so we need to shift bits around. | ||
assert!(array_data.buffers().len() == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert_eq?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Benchmark runs are scheduled for baseline = fb36dd9 and contender = cada9ba. cada9ba is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3496.
Rationale for this change
It seems that the IPC writer doesn't correctly account for sliced boolean columns. See #3496.
What changes are included in this PR?
New IPC writer routine for bools that shifts data correctly + tests.
Are there any user-facing changes?
IPC for bools no longer broken.