Skip to content

Commit

Permalink
rename to Bitmap::bit_len (#1242)
Browse files Browse the repository at this point in the history
Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 authored Jan 28, 2022
1 parent 02573e9 commit aa71aea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions arrow/src/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Bitmap {
}

/// Return the length of this Bitmap in bits (not bytes)
pub fn len(&self) -> usize {
pub fn bit_len(&self) -> usize {
self.bits.len() * 8
}

Expand Down Expand Up @@ -121,9 +121,9 @@ mod tests {

#[test]
fn test_bitmap_length() {
assert_eq!(512, Bitmap::new(63 * 8).len());
assert_eq!(512, Bitmap::new(64 * 8).len());
assert_eq!(1024, Bitmap::new(65 * 8).len());
assert_eq!(512, Bitmap::new(63 * 8).bit_len());
assert_eq!(512, Bitmap::new(64 * 8).bit_len());
assert_eq!(1024, Bitmap::new(65 * 8).bit_len());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/arrow/record_reader/definition_levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ mod tests {
let bitmap = buffer.split_bitmask(19);

// Should have split off 19 records leaving, 81 behind
assert_eq!(bitmap.len(), 3 * 8); // Note: bitmask only tracks bytes not bits
assert_eq!(bitmap.bit_len(), 3 * 8); // Note: bitmask only tracks bytes not bits
assert_eq!(buffer.nulls().len(), 81);
}
}

0 comments on commit aa71aea

Please sign in to comment.