tustvold commented on code in PR #3498:
URL: https://github.com/apache/arrow-rs/pull/3498#discussion_r1064868099
##########
arrow-ipc/src/writer.rs:
##########
@@ -1231,6 +1231,38 @@ fn write_array_data(
compression_codec,
)?;
}
+ } 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);
+ let buffer = &array_data.buffers()[0];
Review Comment:
Could we use Buffer::bit_slice here?
--
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]