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

getdozer / dozer / 4007818786

pending completion
4007818786

Pull #733

github

GitHub
Merge baf5c38aa into 6c0ac2b2c
Pull Request #733: Bump diesel from 2.0.2 to 2.0.3

23389 of 34432 relevant lines covered (67.93%)

40326.78 hits per line

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

38.46
/dozer-sql/src/pipeline/errors.rs
1
#![allow(clippy::enum_variant_names)]
2

3
use dozer_core::dag::errors::ExecutionError;
4
use dozer_core::storage::errors::StorageError;
5
use dozer_types::errors::internal::BoxedError;
6
use dozer_types::errors::types::TypeError;
7
use dozer_types::thiserror;
8
use dozer_types::thiserror::Error;
9
use dozer_types::types::{Field, FieldType};
10
use std::fmt::{Display, Formatter};
11

12
#[derive(Debug, Clone)]
1✔
13
pub struct FieldTypes {
14
    types: Vec<FieldType>,
15
}
16

17
impl FieldTypes {
18
    pub fn new(types: Vec<FieldType>) -> Self {
1✔
19
        Self { types }
1✔
20
    }
1✔
21
}
22

23
impl Display for FieldTypes {
24
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
×
25
        let str_list: Vec<String> = self.types.iter().map(|e| e.to_string()).collect();
×
26
        f.write_str(str_list.join(", ").as_str())
×
27
    }
×
28
}
29

30
#[derive(Error, Debug)]
1✔
31
pub enum PipelineError {
32
    #[error("Invalid operand type for function: {0}()")]
33
    InvalidOperandType(String),
34
    #[error("Invalid input type. Reason: {0}")]
35
    InvalidInputType(String),
36
    #[error("Invalid function: {0}")]
37
    InvalidFunction(String),
38
    #[error("Invalid operator: {0}")]
39
    InvalidOperator(String),
40
    #[error("Invalid expression: {0}")]
41
    InvalidExpression(String),
42
    #[error("Invalid argument: {0}")]
43
    InvalidArgument(String),
44
    #[error("Invalid value: {0}")]
45
    InvalidValue(String),
46
    #[error("Invalid query: {0}")]
47
    InvalidQuery(String),
48
    #[error("Invalid relation")]
49
    InvalidRelation,
50
    #[error("Invalid relation")]
51
    DataTypeMismatch,
52
    #[error("Invalid argument for function {0}(): argument: {1}, index: {2}")]
53
    InvalidFunctionArgument(String, Field, usize),
54
    #[error("Too many arguments for function {0}()")]
55
    TooManyArguments(String),
56
    #[error("Not enough arguments for function {0}()")]
57
    NotEnoughArguments(String),
58
    #[error(
59
        "Invalid argument type for function {0}(): type: {1}, expected types: {2}, index: {3}"
60
    )]
61
    InvalidFunctionArgumentType(String, FieldType, FieldTypes, usize),
62
    #[error("Invalid cast: from: {from}, to: {to}")]
63
    InvalidCast { from: Field, to: FieldType },
64
    #[error("{0}() is invoked from another aggregation function. Nesting of aggregation functions is not possible.")]
65
    InvalidNestedAggregationFunction(String),
66

67
    #[error("Currently join supports two level of namespacing. For example, `connection1.field1` is valid, but `connection1.n1.field1` is not.")]
68
    NameSpaceTooLong(String),
69

70
    // Error forwarding
71
    #[error(transparent)]
72
    InternalStorageError(#[from] StorageError),
73
    #[error(transparent)]
74
    InternalTypeError(#[from] TypeError),
75
    #[error(transparent)]
76
    InternalExecutionError(#[from] ExecutionError),
77
    #[error(transparent)]
78
    InternalError(#[from] BoxedError),
79

80
    #[error(transparent)]
×
81
    UnsupportedSqlError(#[from] UnsupportedSqlError),
82

83
    #[error(transparent)]
84
    JoinError(#[from] JoinError),
85
}
86

87
#[derive(Error, Debug)]
×
88
pub enum UnsupportedSqlError {
89
    #[error("Recursive CTE is not supported. Please refer to the documentation(https://getdozer.io/docs/reference/sql/introduction) for more information. ")]
90
    Recursive,
91
    #[error("Currently this syntax is not supported for CTEs")]
92
    CteFromError,
93
    #[error("Currently only SELECT operations are allowed")]
94
    SelectOnlyError,
95
    #[error("Unsupported syntax in fROM clause")]
96
    JoinTable,
×
97

98
    #[error("FROM clause doesn't support \"Comma Syntax\"")]
99
    FromCommaSyntax,
100
    #[error("ORDER BY is not supported in SQL. You could achieve the same by using the ORDER BY operator in the cache and APIs")]
101
    OrderByError,
102
    #[error("Limit and Offset are not supported in SQL. You could achieve the same by using the LIMIT and OFFSET operators in the cache and APIs")]
103
    LimitOffsetError,
104
}
105

106
#[derive(Error, Debug)]
×
107
pub enum JoinError {
108
    #[error("Field {0:?} not found")]
109
    FieldError(String),
110
    #[error("Currently join supports two level of namespacing. For example, `connection1.field1` is valid, but `connection1.n1.field1` is not.")]
111
    NameSpaceTooLong(String),
112
    #[error("Invalid Join constraint on : {0}")]
113
    InvalidJoinConstraint(String),
114
    #[error("Ambigous field specified in join : {0}")]
115
    AmbiguousField(String),
116
    #[error("Invalid Field specified in join : {0}")]
117
    InvalidFieldSpecified(String),
118
    #[error("Unsupported Join constraint")]
119
    UnsupportedJoinConstraint,
120
    #[error("Unsupported Join type")]
121
    UnsupportedJoinType,
122
    #[error("Invalid Table name specified")]
123
    InvalidRelation(String),
124
}
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