vortex_array/pipeline/
row_selection.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4use crate::operator::{OperatorEq, OperatorRef};
5
6/// Each operator has a row selection over the domain of input rows.
7#[derive(Debug, Clone)]
8pub enum RowSelection {
9    /// Defines a new domain of N rows.
10    Domain(usize),
11    /// Returns all rows from the domain.
12    All,
13    /// Selects rows from the range where the boolean operator resolves to a true bit.
14    MaskOperator(OperatorRef),
15}
16
17impl PartialEq for RowSelection {
18    fn eq(&self, other: &Self) -> bool {
19        match (self, other) {
20            (RowSelection::Domain(n1), RowSelection::Domain(n2)) => n1 == n2,
21            (RowSelection::All, RowSelection::All) => true,
22            (RowSelection::MaskOperator(o1), RowSelection::MaskOperator(o2)) => o1.operator_eq(o2),
23            _ => false,
24        }
25    }
26}
27impl Eq for RowSelection {}