• 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

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

4
use std::fmt::Display;
5

6
use vortex_array::stats::Stat;
7
use vortex_array::{ArrayRef, DeserializeMetadata, EmptyMetadata};
8
use vortex_dtype::{DType, FieldPath};
9
use vortex_error::{VortexResult, vortex_bail};
10

11
use crate::{
12
    AnalysisExpr, ExprEncodingRef, ExprId, ExprRef, IntoExpr, Scope, StatsCatalog, VTable, vtable,
13
};
14

15
vtable!(Root);
16

17
/// An expression that returns the full scope of the expression evaluation.
18
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
19
pub struct RootExpr;
20

21
pub struct RootExprEncoding;
22

23
impl VTable for RootVTable {
24
    type Expr = RootExpr;
25
    type Encoding = RootExprEncoding;
26
    type Metadata = EmptyMetadata;
27

UNCOV
28
    fn id(_encoding: &Self::Encoding) -> ExprId {
×
UNCOV
29
        ExprId::new_ref("root")
×
UNCOV
30
    }
×
31

UNCOV
32
    fn encoding(_expr: &Self::Expr) -> ExprEncodingRef {
×
UNCOV
33
        ExprEncodingRef::new_ref(RootExprEncoding.as_ref())
×
UNCOV
34
    }
×
35

UNCOV
36
    fn metadata(_expr: &Self::Expr) -> Option<Self::Metadata> {
×
UNCOV
37
        Some(EmptyMetadata)
×
UNCOV
38
    }
×
39

40
    fn children(_expr: &Self::Expr) -> Vec<&ExprRef> {
84✔
41
        vec![]
84✔
42
    }
84✔
43

44
    fn with_children(expr: &Self::Expr, _children: Vec<ExprRef>) -> VortexResult<Self::Expr> {
×
45
        Ok(expr.clone())
×
46
    }
×
47

UNCOV
48
    fn build(
×
UNCOV
49
        _encoding: &Self::Encoding,
×
UNCOV
50
        _metadata: &<Self::Metadata as DeserializeMetadata>::Output,
×
UNCOV
51
        children: Vec<ExprRef>,
×
UNCOV
52
    ) -> VortexResult<Self::Expr> {
×
UNCOV
53
        if !children.is_empty() {
×
54
            vortex_bail!(
×
55
                "Root expression does not have children, got: {:?}",
×
56
                children
57
            );
UNCOV
58
        }
×
UNCOV
59
        Ok(RootExpr)
×
UNCOV
60
    }
×
61

62
    fn evaluate(_expr: &Self::Expr, scope: &Scope) -> VortexResult<ArrayRef> {
8✔
63
        Ok(scope.root().clone())
8✔
64
    }
8✔
65

66
    fn return_dtype(_expr: &Self::Expr, scope: &DType) -> VortexResult<DType> {
16✔
67
        Ok(scope.clone())
16✔
68
    }
16✔
69
}
70

71
impl Display for RootExpr {
UNCOV
72
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
×
UNCOV
73
        write!(f, "$")
×
UNCOV
74
    }
×
75
}
76

77
impl AnalysisExpr for RootExpr {
UNCOV
78
    fn max(&self, catalog: &mut dyn StatsCatalog) -> Option<ExprRef> {
×
UNCOV
79
        catalog.stats_ref(&self.field_path()?, Stat::Max)
×
UNCOV
80
    }
×
81

UNCOV
82
    fn min(&self, catalog: &mut dyn StatsCatalog) -> Option<ExprRef> {
×
UNCOV
83
        catalog.stats_ref(&self.field_path()?, Stat::Min)
×
UNCOV
84
    }
×
85

UNCOV
86
    fn nan_count(&self, catalog: &mut dyn StatsCatalog) -> Option<ExprRef> {
×
UNCOV
87
        catalog.stats_ref(&self.field_path()?, Stat::NaNCount)
×
UNCOV
88
    }
×
89

UNCOV
90
    fn field_path(&self) -> Option<FieldPath> {
×
UNCOV
91
        Some(FieldPath::root())
×
UNCOV
92
    }
×
93
}
94

95
/// Return a global pointer to the identity token.
96
/// This is the name of the data found in a vortex array or file.
97
pub fn root() -> ExprRef {
26✔
98
    RootExpr.into_expr()
26✔
99
}
26✔
100

101
/// Return whether the expression is a root expression.
102
pub fn is_root(expr: &ExprRef) -> bool {
14✔
103
    expr.is::<RootVTable>()
14✔
104
}
14✔
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