• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16992335779

15 Aug 2025 02:38PM UTC coverage: 87.202% (-0.5%) from 87.72%
16992335779

Pull #2456

github

web-flow
Merge 39c262e2c into 4a23f65b3
Pull Request #2456: feat: basic BoolBuffer / BoolBufferMut

476 of 1231 new or added lines in 107 files covered. (38.67%)

74 existing lines in 19 files now uncovered.

56525 of 64821 relevant lines covered (87.2%)

623742.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/vortex-array/src/arrays/bool/compute/sum.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::ops::BitAnd;
5

6
use vortex_error::VortexResult;
7
use vortex_mask::AllOr;
8
use vortex_scalar::Scalar;
9

10
use crate::arrays::{BoolArray, BoolVTable};
11
use crate::compute::{SumKernel, SumKernelAdapter};
12
use crate::register_kernel;
13

14
impl SumKernel for BoolVTable {
15
    fn sum(&self, array: &BoolArray) -> VortexResult<Scalar> {
19,731✔
16
        let true_count: Option<u64> = match array.validity_mask()?.boolean_buffer() {
19,731✔
17
            AllOr::All => {
18
                // All-valid
19
                Some(array.boolean_buffer().count_set_bits() as u64)
19,731✔
20
            }
21
            AllOr::None => {
22
                // All-invalid
23
                unreachable!("All-invalid boolean array should have been handled by entry-point")
×
24
            }
NEW
25
            AllOr::Some(validity_mask) => Some(
×
NEW
26
                array
×
27
                    .boolean_buffer()
28
                    .bitand(validity_mask)
UNCOV
29
                    .count_set_bits() as u64,
×
UNCOV
30
            ),
×
31
        };
32
        Ok(Scalar::from(true_count))
19,731✔
33
    }
19,731✔
34
}
35

36
register_kernel!(SumKernelAdapter(BoolVTable).lift());
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc