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

getdozer / dozer / 6015776084

29 Aug 2023 06:23PM UTC coverage: 75.53% (-0.8%) from 76.332%
6015776084

push

github

web-flow
Bump clap from 4.3.11 to 4.4.1 (#1941)

Bumps [clap](https://github.com/clap-rs/clap) from 4.3.11 to 4.4.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.3.11...v4.4.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

49075 of 64974 relevant lines covered (75.53%)

65362.51 hits per line

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

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

3
use dozer_core::node::PortHandle;
4
use dozer_storage::errors::StorageError;
5
use dozer_types::chrono::RoundingError;
6
use dozer_types::errors::internal::BoxedError;
7
use dozer_types::errors::types::TypeError;
8
use dozer_types::thiserror;
9
use dozer_types::thiserror::Error;
10
use dozer_types::types::{Field, FieldType};
11
use std::fmt::{Display, Formatter};
12

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

×
18
impl FieldTypes {
19
    pub fn new(types: Vec<FieldType>) -> Self {
2,002✔
20
        Self { types }
2,002✔
21
    }
2,002✔
22
}
23

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

×
31
#[derive(Error, Debug)]
2✔
32
pub enum PipelineError {
×
33
    #[error("Invalid operand type for function: {0}()")]
34
    InvalidOperandType(String),
35
    #[error("Invalid input type. Reason: {0}")]
×
36
    InvalidInputType(String),
37
    #[error("Invalid return type: {0}")]
38
    InvalidReturnType(String),
39
    #[error("Invalid function: {0}")]
40
    InvalidFunction(String),
41
    #[error("Invalid operator: {0}")]
42
    InvalidOperator(String),
43
    #[error("Invalid expression: {0}")]
44
    InvalidExpression(String),
45
    #[error("Invalid argument: {0}")]
46
    InvalidArgument(String),
47
    #[error("Invalid types on {0} and {1} for {2} operand")]
48
    InvalidTypeComparison(Field, Field, String),
49
    #[error("Invalid types on {0} for {1} operand")]
50
    InvalidType(Field, String),
51
    #[error("Invalid value: {0}")]
52
    InvalidValue(String),
53
    #[error("Invalid query: {0}")]
54
    InvalidQuery(String),
55
    #[error("Invalid relation")]
56
    InvalidRelation,
57
    #[error("Invalid relation")]
58
    DataTypeMismatch,
59
    #[error("Invalid argument for function {0}(): argument: {1}, index: {2}")]
60
    InvalidFunctionArgument(String, Field, usize),
61
    #[error("Too many arguments for function {0}()")]
62
    TooManyArguments(String),
63
    #[error("Not enough arguments for function {0}()")]
64
    NotEnoughArguments(String),
65
    #[error(
66
        "Invalid argument type for function {0}(): type: {1}, expected types: {2}, index: {3}"
67
    )]
68
    InvalidFunctionArgumentType(String, FieldType, FieldTypes, usize),
69
    #[error("Mismatching argument types for {0}(): {1}, consider using CAST function")]
70
    InvalidConditionalExpression(String, FieldTypes),
71
    #[error("Invalid cast: from: {from}, to: {to}")]
72
    InvalidCast { from: Field, to: FieldType },
73
    #[error("{0}() cannot be called from here. Aggregations can only be used in SELECT and HAVING and cannot be nested within other aggregations.")]
74
    InvalidNestedAggregationFunction(String),
75
    #[error("Field {0} is not present in the source schema")]
76
    UnknownFieldIdentifier(String),
77
    #[error(
78
        "Field {0} is ambiguous. Specify a fully qualified name such as [connection.]source.field"
79
    )]
80
    AmbiguousFieldIdentifier(String),
81
    #[error("The field identifier {0} is invalid. Correct format is: [[connection.]source.]field")]
82
    IllegalFieldIdentifier(String),
83
    #[error("Unable to cast {0} to {1}")]
84
    UnableToCast(String, String),
85
    #[error("Missing INTO clause for top-level SELECT statement")]
86
    MissingIntoClause,
87
    #[cfg(feature = "python")]
88
    #[error("Python Error: {0}")]
89
    PythonErr(dozer_types::pyo3::PyErr),
90

91
    // Error forwarding
92
    #[error("Internal type error: {0}")]
93
    InternalTypeError(#[from] TypeError),
94
    #[error("Internal error: {0}")]
95
    InternalError(#[from] BoxedError),
96

97
    #[error("Unsupported sql: {0}")]
98
    UnsupportedSqlError(#[from] UnsupportedSqlError),
99

100
    #[error("Join: {0}")]
101
    JoinError(#[from] JoinError),
102

103
    #[error("Product: {0}")]
104
    ProductError(#[from] ProductError),
105

106
    #[error("Set: {0}")]
107
    SetError(#[from] SetError),
108

109
    #[error("Sql: {0}")]
110
    SqlError(#[from] SqlError),
111

112
    #[error("Window: {0}")]
113
    WindowError(#[from] WindowError),
114

115
    #[error("Table Function is not supported")]
116
    UnsupportedTableFunction,
117

118
    #[error("UNNEST not supported")]
119
    UnsupportedUnnest,
120

121
    #[error("Nested Join is not supported")]
122
    UnsupportedNestedJoin,
123

124
    #[error("Pivot is not supported")]
125
    UnsupportedPivot,
126

127
    #[error("Table Operator: {0} is not supported")]
128
    UnsupportedTableOperator(String),
129

130
    #[error("Invalid JOIN: {0}")]
131
    InvalidJoin(String),
132

133
    #[error("The JOIN clause is not supported. In this version only INNER, LEFT and RIGHT OUTER JOINs are supported")]
134
    UnsupportedJoinType,
135

136
    #[error(
137
        "Unsupported JOIN constraint, only ON is allowed as the JOIN constraint using \'=\' and \'AND\' operators"
138
    )]
139
    UnsupportedJoinConstraintType,
140

141
    #[error("Unsupported JOIN constraint {0} only comparison of fields with \'=\' and \'AND\' operators are allowed in the JOIN ON constraint")]
142
    UnsupportedJoinConstraint(String),
143

144
    #[error("Invalid JOIN constraint on: {0}")]
145
    InvalidJoinConstraint(String),
146

147
    #[error(
148
        "Unsupported JOIN constraint operator {0}, only \'=\' and \'AND\' operators are allowed in the JOIN ON constraint"
149
    )]
150
    UnsupportedJoinConstraintOperator(String),
151

152
    #[error("Invalid Field specified in JOIN: {0}")]
153
    InvalidFieldSpecified(String),
154

155
    #[error("Currently JOIN supports two level of namespacing. For example, `source.field_name` is valid, but `connection.source.field_name` is not.")]
156
    NameSpaceTooLong(String),
157

158
    #[error("Error building the JOIN on the {0} source of the Processor")]
159
    JoinBuild(String),
160

161
    #[error("Window: {0}")]
162
    TableOperatorError(#[from] TableOperatorError),
163

164
    #[error("Invalid port handle: {0}")]
165
    InvalidPortHandle(PortHandle),
166
    #[error("JOIN processor received a Record from a wrong input: {0}")]
167
    InvalidPort(u16),
168
}
169

170
#[cfg(feature = "python")]
171
impl From<dozer_types::pyo3::PyErr> for PipelineError {
172
    fn from(py_err: dozer_types::pyo3::PyErr) -> Self {
×
173
        PipelineError::PythonErr(py_err)
×
174
    }
×
175
}
176

177
#[derive(Error, Debug)]
×
178
pub enum UnsupportedSqlError {
179
    #[error("Recursive CTE is not supported. Please refer to the documentation(https://getdozer.io/docs/reference/sql/introduction) for more information. ")]
180
    Recursive,
181
    #[error("Currently this syntax is not supported for CTEs")]
182
    CteFromError,
183
    #[error("Currently only SELECT operations are allowed")]
184
    SelectOnlyError,
185
    #[error("Unsupported syntax in FROM clause")]
×
186
    JoinTable,
×
187

×
188
    #[error("FROM clause doesn't support \"Comma Syntax\"")]
189
    FromCommaSyntax,
190
    #[error("ORDER BY is not supported in SQL. You could achieve the same by using the ORDER BY operator in the cache and APIs")]
×
191
    OrderByError,
192
    #[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")]
193
    LimitOffsetError,
194
    #[error("Select statements should specify INTO for creating output tables")]
195
    IntoError,
196

197
    #[error("Unsupported SQL statement {0}")]
198
    GenericError(String),
199
}
200

201
#[derive(Error, Debug)]
×
202
pub enum SqlError {
203
    #[error("SQL Error: The first argument of the {0} function must be a source name.")]
204
    WindowError(String),
205
    #[error("SQL Error: Invalid column name {0}.")]
206
    InvalidColumn(String),
207
    #[error(transparent)]
208
    Operation(#[from] OperationError),
209
}
210

211
#[derive(Error, Debug)]
×
212
pub enum OperationError {
213
    #[error("SQL Error: Addition operation cannot be done due to overflow.")]
214
    AdditionOverflow,
×
215
    #[error("SQL Error: Subtraction operation cannot be done due to overflow.")]
216
    SubtractionOverflow,
217
    #[error("SQL Error: Multiplication operation cannot be done due to overflow.")]
218
    MultiplicationOverflow,
219
    #[error("SQL Error: Division operation cannot be done.")]
220
    DivisionByZeroOrOverflow,
221
    #[error("SQL Error: Modulo operation cannot be done.")]
222
    ModuloByZeroOrOverflow,
223
}
224

×
225
#[derive(Error, Debug)]
×
226
pub enum SetError {
227
    #[error("Invalid input schemas have been populated")]
228
    InvalidInputSchemas,
229
    #[error("Database unavailable for SET")]
230
    DatabaseUnavailable,
231
    #[error("History unavailable for SET source [{0}]")]
232
    HistoryUnavailable(u16),
233
}
234

235
#[derive(Error, Debug)]
×
236
pub enum JoinError {
237
    #[error("Currently join supports two level of namespacing. For example, `connection1.field1` is valid, but `connection1.n1.field1` is not.")]
238
    NameSpaceTooLong(String),
×
239
    #[error("Invalid Join constraint on : {0}")]
240
    InvalidJoinConstraint(String),
241
    #[error("Ambigous field specified in join : {0}")]
242
    AmbiguousField(String),
243
    #[error("Invalid Field specified in join : {0}")]
244
    InvalidFieldSpecified(String),
245
    #[error("Unsupported Join constraint {0} only comparison of fields with \'=\' and \'AND\' operators are allowed in the JOIN ON constraint")]
246
    UnsupportedJoinConstraint(String),
247
    #[error(
248
        "Unsupported Join constraint operator {0}, only \'=\' and \'AND\' operators are allowed in the JOIN ON constraint"
×
249
    )]
250
    UnsupportedJoinConstraintOperator(String),
251
    #[error(
252
        "Unsupported Join constraint, only ON is allowed as the JOIN constraint using \'=\' and \'AND\' operators"
253
    )]
254
    UnsupportedJoinConstraintType,
255
    #[error("Unsupported Join type")]
256
    UnsupportedJoinType,
257

258
    #[error("Overflow error computing the eviction time in the TTL reference field")]
259
    EvictionTimeOverflow,
260

261
    #[error("Field type error computing the eviction time in the TTL reference field")]
262
    EvictionTypeOverflow,
263

264
    #[error("Storage error: {0}")]
265
    Storage(#[from] StorageError),
266
}
267

268
#[derive(Error, Debug)]
×
269
pub enum ProductError {
270
    #[error("Product Processor Database is not initialised properly")]
271
    InvalidDatabase(),
272

273
    #[error("Error deleting a record coming from {0}\n{1}")]
274
    DeleteError(String, #[source] BoxedError),
275

276
    #[error("Error inserting a record coming from {0}\n{1}")]
277
    InsertError(String, #[source] BoxedError),
278

279
    #[error("Error updating a record from {0} cannot delete the old entry\n{1}")]
280
    UpdateOldError(String, #[source] BoxedError),
281

×
282
    #[error("Error updating a record from {0} cannot insert the new entry\n{1}")]
283
    UpdateNewError(String, #[source] BoxedError),
284

285
    #[error("Error in the FROM clause, Table Function is not supported")]
286
    UnsupportedTableFunction,
287

288
    #[error("Error in the FROM clause, UNNEST is not supported")]
289
    UnsupportedUnnest,
290

291
    #[error("Error in the FROM clause, Pivot is not supported")]
292
    UnsupportedPivot,
293
}
294

295
#[derive(Error, Debug)]
×
296
pub enum WindowError {
297
    #[error("Error in the FROM clause, Invalid function {0:x?}")]
298
    UnsupportedRelationFunction(String),
299

300
    #[error("Column name not specified in the window function")]
301
    WindowMissingColumnArgument,
302

303
    #[error("Interval not specified in the window function")]
304
    WindowMissingIntervalArgument,
305

306
    #[error("Hop size not specified in the window function")]
307
    WindowMissingHopSizeArgument,
308

×
309
    #[error("Invalid time reference column {0} in the window function")]
310
    WindowInvalidColumn(String),
311

312
    #[error("Invalid time interval '{0}' specified in the window function")]
313
    WindowInvalidInterval(String),
314

315
    #[error("Invalid time hop '{0}' specified in the window function")]
316
    WindowInvalidHop(String),
317

318
    #[error("Error in the FROM clause, Derived Table is not supported")]
319
    UnsupportedDerivedTable,
320

321
    #[error("Error in the FROM clause, Table Function is not supported")]
322
    UnsupportedTableFunction,
323

324
    #[error("Error in the FROM clause, UNNEST is not supported")]
325
    UnsupportedUnnest,
326

327
    #[error("This type of Nested Join is not supported")]
328
    UnsupportedNestedJoin,
329

330
    #[error("Invalid column specified in Tumble Windowing function.\nOnly Timestamp and Date types are supported")]
331
    TumbleInvalidColumnType(),
332
    #[error("Invalid column specified in Tumble Windowing function.")]
333
    TumbleInvalidColumnIndex(),
334
    #[error("Error in Tumble Windowing function:\n{0}")]
335
    TumbleRoundingError(#[source] RoundingError),
336

337
    #[error("Invalid column specified in Hop Windowing function.\nOnly Timestamp and Date types are supported")]
338
    HopInvalidColumnType(),
339
    #[error("Invalid column specified in Hop Windowing function.")]
340
    HopInvalidColumnIndex(),
341
    #[error("Error in Hop Windowing function:\n{0}")]
342
    HopRoundingError(#[source] RoundingError),
343

344
    #[error("Invalid WINDOW function")]
345
    InvalidWindow(),
346

347
    #[error("For WINDOW functions and alias must be specified")]
348
    AliasNotSpecified(),
349

350
    #[error("Source table not specified in the window function")]
351
    WindowMissingSourceArgument,
352

353
    #[error("Error in the FROM clause, Derived Table is not supported as WINDOW source")]
354
    UnsupportedDerived,
355

356
    #[error("Invalid source table {0} in the window function")]
357
    WindowInvalidSource(String),
358

359
    #[error("WINDOW functions require alias")]
360
    NoAlias,
361

362
    #[error("Storage error")]
363
    Storage(#[from] StorageError),
364
}
365

366
#[derive(Error, Debug)]
×
367
pub enum TableOperatorError {
368
    #[error("Internal error: {0}")]
369
    InternalError(#[from] BoxedError),
370

371
    #[error("Source Table not specified in the Table Operator {0}")]
372
    MissingSourceArgument(String),
373

374
    #[error("Invalid source table {0} in the Table Operator {1}")]
375
    InvalidSourceArgument(String, String),
376

377
    #[error("Interval is not specified in the Table Operator {0}")]
378
    MissingIntervalArgument(String),
379

×
380
    #[error("Invalid time interval '{0}' specified in the Table Operator {1}")]
381
    InvalidInterval(String, String),
382

383
    #[error("Invalid reference expression '{0}' specified in the Table Operator {1}")]
384
    InvalidReference(String, String),
385

386
    #[error("Missing Argument in '{0}' ")]
387
    MissingArgument(String),
388

389
    #[error("TTL input must evaluate to timestamp, but it evaluates to {0}")]
390
    InvalidTtlInputType(Field),
391

392
    #[error("Storage error")]
393
    Storage(#[from] StorageError),
394
}
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