tustvold commented on code in PR #2693:
URL: https://github.com/apache/arrow-rs/pull/2693#discussion_r971124724
##########
arrow/src/bitmap.rs:
##########
@@ -79,15 +80,37 @@ impl<'a, 'b> BitAnd<&'b Bitmap> for &'a Bitmap {
type Output = Result<Bitmap>;
fn bitand(self, rhs: &'b Bitmap) -> Result<Bitmap> {
- Ok(Bitmap::from((&self.bits & &rhs.bits)?))
+ if self.bits.len() != rhs.bits.len() {
+ return Err(ArrowError::ComputeError(
+ "Buffers must be the same size to apply Bitwise
AND.".to_string(),
+ ));
+ }
+ Ok(Bitmap::from(buffer_bin_and(
+ &self.bits,
+ 0,
Review Comment:
BitMap currently doesn't have an offset, this does mean that practically
this implementation is likely being used incorrectly in places, but I opted to
just preserve the existing behaviour. I agree it is a bit of a footgun #1802
--
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]