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

getdozer / dozer / 3966048167

pending completion
3966048167

Pull #689

github

GitHub
Merge 3a60b4ffb into 7b824f4d0
Pull Request #689: fix: change mapping of sqlite data type to dozer data type

22014 of 32813 relevant lines covered (67.09%)

36240.78 hits per line

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

41.67
/dozer-sql/src/pipeline/expression/aggregate.rs
1
use crate::pipeline::errors::PipelineError;
2
use crate::pipeline::errors::PipelineError::InvalidFunction;
3
use std::fmt::{Display, Formatter};
4

5
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Hash)]
84✔
6
pub enum AggregateFunctionType {
7
    Avg,
8
    Count,
9
    Max,
10
    Median,
11
    Min,
12
    Sum,
13
    Stddev,
14
    Variance,
15
}
16

17
impl AggregateFunctionType {
18
    pub(crate) fn new(name: &str) -> Result<AggregateFunctionType, PipelineError> {
169✔
19
        match name {
169✔
20
            "avg" => Ok(AggregateFunctionType::Avg),
169✔
21
            "count" => Ok(AggregateFunctionType::Count),
155✔
22
            "max" => Ok(AggregateFunctionType::Max),
62✔
23
            "median" => Ok(AggregateFunctionType::Median),
40✔
24
            "min" => Ok(AggregateFunctionType::Min),
40✔
25
            "sum" => Ok(AggregateFunctionType::Sum),
18✔
26
            "stddev" => Ok(AggregateFunctionType::Stddev),
×
27
            "variance" => Ok(AggregateFunctionType::Variance),
×
28
            _ => Err(InvalidFunction(name.to_string())),
×
29
        }
30
    }
169✔
31
}
32

33
impl Display for AggregateFunctionType {
34
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
×
35
        match self {
×
36
            AggregateFunctionType::Avg => f.write_str("AVG"),
×
37
            AggregateFunctionType::Count => f.write_str("COUNT"),
×
38
            AggregateFunctionType::Max => f.write_str("MAX"),
×
39
            AggregateFunctionType::Median => f.write_str("MEDIAN"),
×
40
            AggregateFunctionType::Min => f.write_str("MIN"),
×
41
            AggregateFunctionType::Sum => f.write_str("SUM"),
×
42
            AggregateFunctionType::Stddev => f.write_str("STDDEV"),
×
43
            AggregateFunctionType::Variance => f.write_str("VARIANCE"),
×
44
        }
45
    }
×
46
}
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

© 2025 Coveralls, Inc