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

getdozer / dozer / 3965135367

pending completion
3965135367

Pull #680

github

GitHub
Merge 1add77327 into 56c0cf2b3
Pull Request #680: feat: Implement nested queries and CTE.

506 of 506 new or added lines in 18 files covered. (100.0%)

21999 of 33062 relevant lines covered (66.54%)

50489.13 hits per line

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

45.45
/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("Not enough arguments for function {0}()")]
55
    NotEnoughArguments(String),
56
    #[error(
57
        "Invalid argument type for function {0}(): type: {1}, expected types: {2}, index: {3}"
58
    )]
59
    InvalidFunctionArgumentType(String, FieldType, FieldTypes, usize),
60
    #[error("Invalid cast: from: {from}, to: {to}")]
61
    InvalidCast { from: Field, to: FieldType },
62

63
    // Error forwarding
64
    #[error(transparent)]
65
    InternalStorageError(#[from] StorageError),
66
    #[error(transparent)]
67
    InternalTypeError(#[from] TypeError),
68
    #[error(transparent)]
69
    InternalExecutionError(#[from] ExecutionError),
70
    #[error(transparent)]
71
    InternalError(#[from] BoxedError),
72

73
    #[error(transparent)]
74
    UnsupportedSqlError(#[from] UnsupportedSqlError),
75

76
    #[error(transparent)]
77
    JoinError(#[from] JoinError),
78
}
79

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

96
#[derive(Error, Debug)]
×
97
pub enum JoinError {
98
    #[error("Field {0:?} not found")]
99
    FieldError(String),
100
}
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