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

vortex-data / vortex / 16935267080

13 Aug 2025 11:00AM UTC coverage: 24.312% (-63.3%) from 87.658%
16935267080

Pull #4226

github

web-flow
Merge 81b48c7fb into baa6ea202
Pull Request #4226: Support converting TimestampTZ to and from duckdb

0 of 2 new or added lines in 1 file covered. (0.0%)

20666 existing lines in 469 files now uncovered.

8726 of 35892 relevant lines covered (24.31%)

147.74 hits per line

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

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

4
use vortex_dtype::{FieldName, StructFields};
5
use vortex_error::VortexExpect;
6
use vortex_utils::aliases::hash_set::HashSet;
7

8
use crate::transform::annotations::{AnnotationFn, Annotations, descendent_annotations};
9
use crate::{ExprRef, GetItemVTable, SelectVTable, is_root};
10

11
pub type FieldAccesses<'a> = Annotations<'a, FieldName>;
12

13
/// An [`AnnotationFn`] for annotating scope accesses.
14
pub fn annotate_scope_access(scope: &StructFields) -> impl AnnotationFn<Annotation = FieldName> {
4✔
15
    move |expr: &ExprRef| {
8✔
16
        assert!(
8✔
17
            !expr.is::<SelectVTable>(),
8✔
18
            "cannot analyse select, simplify the expression"
×
19
        );
20

21
        if let Some(get_item) = expr.as_opt::<GetItemVTable>() {
8✔
22
            if is_root(get_item.child()) {
4✔
23
                return vec![get_item.field().clone()];
4✔
UNCOV
24
            }
×
25
        } else if is_root(expr) {
4✔
26
            return scope.names().iter().cloned().collect();
2✔
27
        }
2✔
28

29
        vec![]
2✔
30
    }
8✔
31
}
4✔
32

33
/// For all subexpressions in an expression, find the fields that are accessed directly from the
34
/// scope, but not any fields in those fields
35
/// e.g. scope = {a: {b: .., c: ..}, d: ..}, expr = root().a.b + root().d accesses {a,d} (not b).
36
///
37
/// Note: This is a very naive, but simple analysis to find the fields that are accessed directly on an
38
/// identity node. This is combined to provide an over-approximation of the fields that are accessed
39
/// by an expression.
40
pub fn immediate_scope_accesses<'a>(
2✔
41
    expr: &'a ExprRef,
2✔
42
    scope: &'a StructFields,
2✔
43
) -> FieldAccesses<'a> {
2✔
44
    descendent_annotations(expr, annotate_scope_access(scope))
2✔
45
}
2✔
46

47
/// This returns the immediate scope_access (as explained `immediate_scope_accesses`) for `expr`.
48
pub fn immediate_scope_access<'a>(
2✔
49
    expr: &'a ExprRef,
2✔
50
    scope: &'a StructFields,
2✔
51
) -> HashSet<FieldName> {
2✔
52
    immediate_scope_accesses(expr, scope)
2✔
53
        .get(expr)
2✔
54
        .vortex_expect("Expression missing from scope accesses, this is a internal bug")
2✔
55
        .clone()
2✔
56
}
2✔
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