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

Rename the function Bitmap::len to Bitmap::bit_len to clarify its meaning #1242

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}
}