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

vortex-data / vortex / 16204612549

10 Jul 2025 07:50PM UTC coverage: 81.152% (+2.9%) from 78.263%
16204612549

Pull #3825

github

web-flow
Merge d0d2717da into be9c2fd3e
Pull Request #3825: feat: Add optimize ArrayOp with VBView implementation

178 of 211 new or added lines in 4 files covered. (84.36%)

330 existing lines in 34 files now uncovered.

45433 of 55985 relevant lines covered (81.15%)

145951.87 hits per line

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

40.0
/vortex-expr/src/analysis.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use vortex_array::stats::Stat;
5
use vortex_dtype::FieldPath;
6

7
use crate::ExprRef;
8

9
pub trait StatsCatalog {
10
    /// Given a field path and statist, return an expression that when evaluated over the catalog
11
    /// will return that stat for the referenced field.
12
    ///
13
    /// This is likely to be a column expression, or a literal.
14
    ///
15
    /// Returns `None` if the stat is not available for the field path.
UNCOV
16
    fn stats_ref(&mut self, _field_path: &FieldPath, _stat: Stat) -> Option<ExprRef> {
×
UNCOV
17
        None
×
UNCOV
18
    }
×
19
}
20

21
/// This can be used by expression to plug into vortex expression analysis, such as
22
/// pruning or expression simplification
23
pub trait AnalysisExpr {
24
    /// An expression over zone-statistics which implies all records in the zone evaluate to false.
25
    ///
26
    /// Given an expression, `e`, if `e.stat_falsification(..)` evaluates to true, it is guaranteed
27
    /// that `e` evaluates to false on all records in the zone. However, the inverse is not
28
    /// necessarily true: even if the falsification evaluates to false, `e` need not evaluate to
29
    /// true on all records.
30
    ///
31
    /// The `StatsCatalog` can be used to constrain or rename stats used in the final expr.
32
    ///
33
    /// # Examples
34
    ///
35
    /// - An expression over one variable: `x > 0` is false for all records in a zone if the maximum
36
    ///   value of the column `x` in that zone is less than or equal to zero: `max(x) <= 0`.
37
    /// - An expression over two variables: `x > y` becomes `max(x) <= min(y)`.
38
    /// - A conjunctive expression: `x > y AND z < x` becomes `max(x) <= min(y) OR min(z) >= max(x).
39
    ///
40
    /// Some expressions, in theory, have falsifications but this function does not support them
41
    /// such as `x < (y < z)` or `x LIKE "needle%"`.
42
    fn stat_falsification(&self, _catalog: &mut dyn StatsCatalog) -> Option<ExprRef> {
76✔
43
        None
76✔
44
    }
76✔
45

46
    /// An expression for the upper non-null bound of this expression, if available.
47
    ///
48
    /// This function returns None if there is no upper bound or it is difficult to compute.
49
    ///
50
    /// The returned expression evaluates to null if the maximum value is unknown. In that case, you
51
    /// _must not_ assume the array is empty _nor_ may you assume the array only contains non-null
52
    /// values.
UNCOV
53
    fn max(&self, _catalog: &mut dyn StatsCatalog) -> Option<ExprRef> {
×
UNCOV
54
        None
×
UNCOV
55
    }
×
56

57
    /// An expression for the lower non-null bound of this expression, if available.
58
    ///
59
    /// See [AnalysisExpr::max] for important details.
60
    fn min(&self, _catalog: &mut dyn StatsCatalog) -> Option<ExprRef> {
1✔
61
        None
1✔
62
    }
1✔
63

UNCOV
64
    fn field_path(&self) -> Option<FieldPath> {
×
UNCOV
65
        None
×
UNCOV
66
    }
×
67

68
    // TODO: add containment
69
}
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