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

getdozer / dozer / 4370408272

pending completion
4370408272

push

github

GitHub
fix: Fix compilation error introduced in #1158 (#1183)

3 of 3 new or added lines in 1 file covered. (100.0%)

28163 of 39541 relevant lines covered (71.22%)

73625.66 hits per line

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

96.77
/dozer-sql/src/pipeline/expression/geo/common.rs
1
use crate::pipeline::errors::PipelineError;
2
use crate::pipeline::expression::execution::{Expression, ExpressionType};
3

4
use crate::pipeline::expression::geo::distance::{evaluate_distance, validate_distance};
5
use crate::pipeline::expression::geo::point::{evaluate_point, validate_point};
6
use dozer_types::types::{Field, Record, Schema};
7
use std::fmt::{Display, Formatter};
8

9
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Hash)]
7✔
10
pub enum GeoFunctionType {
11
    Point,
12
    Distance,
13
}
14

15
impl Display for GeoFunctionType {
16
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
9✔
17
        match self {
9✔
18
            GeoFunctionType::Point => f.write_str("POINT"),
5✔
19
            GeoFunctionType::Distance => f.write_str("DISTANCE"),
4✔
20
        }
21
    }
9✔
22
}
23

24
pub(crate) fn get_geo_function_type(
7✔
25
    function: &GeoFunctionType,
7✔
26
    args: &[Expression],
7✔
27
    schema: &Schema,
7✔
28
) -> Result<ExpressionType, PipelineError> {
7✔
29
    match function {
7✔
30
        GeoFunctionType::Point => validate_point(args, schema),
2✔
31
        GeoFunctionType::Distance => validate_distance(args, schema),
5✔
32
    }
33
}
7✔
34

35
impl GeoFunctionType {
36
    pub fn new(name: &str) -> Result<GeoFunctionType, PipelineError> {
14✔
37
        match name {
14✔
38
            "point" => Ok(GeoFunctionType::Point),
14✔
39
            "distance" => Ok(GeoFunctionType::Distance),
10✔
40
            _ => Err(PipelineError::InvalidFunction(name.to_string())),
×
41
        }
42
    }
14✔
43

44
    pub(crate) fn evaluate(
7✔
45
        &self,
7✔
46
        schema: &Schema,
7✔
47
        args: &[Expression],
7✔
48
        record: &Record,
7✔
49
    ) -> Result<Field, PipelineError> {
7✔
50
        match self {
7✔
51
            GeoFunctionType::Point => evaluate_point(schema, args, record),
2✔
52
            GeoFunctionType::Distance => evaluate_distance(schema, args, record),
5✔
53
        }
54
    }
7✔
55
}
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