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

Improve documentation for Bitmap #1237

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions arrow/src/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//! Defines a bitmap, which is used to track which values in an Arrow array are null.
//! This is called a "validity bitmap" in the Arrow documentation.
//! Defines [Bitmap] for tracking validity bitmaps

use crate::buffer::Buffer;
use crate::error::Result;
Expand All @@ -26,6 +25,10 @@ use std::mem;
use std::ops::{BitAnd, BitOr};

#[derive(Debug, Clone)]
/// Defines a bitmap, which is used to track which values in an Arrow
/// array are null.
///
/// This is called a "validity bitmap" in the Arrow documentation.
pub struct Bitmap {
pub(crate) bits: Buffer,
}
Expand All @@ -44,6 +47,7 @@ impl Bitmap {
}
}

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