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

vortex-data / vortex / 16876672762

11 Aug 2025 09:53AM UTC coverage: 86.203% (-0.03%) from 86.228%
16876672762

push

github

web-flow
fix[scan]: don't convert filter to `cnf` just extract conjunct list (#4174)

This PR replaces cnf extract with and unpacking.
We could look later at either trying to cnf transform with a conversion
expression size cap?

---------

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>

18 of 19 new or added lines in 3 files covered. (94.74%)

7 existing lines in 3 files now uncovered.

53394 of 61940 relevant lines covered (86.2%)

546700.74 hits per line

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

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

4
use crate::{BinaryVTable, ExprRef};
5

6
/// Converting an expression to a conjunctive normal form can lead to a large number of expression
7
/// nodes.
8
/// For now, we will just extract the conjuncts from the expression, and return a vector of conjuncts.
9
/// We could look at try cnf with a size cap and otherwise return the original conjuncts.
10
pub fn conjuncts(expr: &ExprRef) -> Vec<ExprRef> {
40,105✔
11
    let mut conjuncts = vec![];
40,105✔
12
    conjuncts_impl(expr, &mut conjuncts);
40,105✔
13
    if conjuncts.is_empty() {
40,105✔
NEW
14
        conjuncts.push(expr.clone());
×
15
    }
40,105✔
16
    conjuncts
40,105✔
17
}
40,105✔
18

19
fn conjuncts_impl(expr: &ExprRef, conjuncts: &mut Vec<ExprRef>) {
42,383✔
20
    if let Some(expr) = expr.as_opt::<BinaryVTable>()
42,383✔
21
        && expr.op() == crate::Operator::And
5,209✔
22
    {
1,139✔
23
        conjuncts_impl(expr.lhs(), conjuncts);
1,139✔
24
        conjuncts_impl(expr.rhs(), conjuncts);
1,139✔
25
    } else {
1,139✔
26
        conjuncts.push(expr.clone())
41,244✔
27
    }
28
}
42,383✔
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