1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use thiserror::Error;
/// Crate-wide error type.
#[derive(Debug, Error)]
pub enum Error {
/// Invalid UTF-8 in input bytes.
#[error("invalid UTF-8: {0}")]
Utf8(#[from] simdutf8::basic::Utf8Error),
/// I/O failure (read, seek, mmap, etc.).
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
/// Invalid or inconsistent execution plan.
#[error("plan error: {0}")]
Plan(String),
/// A strict executor memory allowance was exceeded.
#[error("memory budget exceeded: {used} bytes used, limit {limit} bytes")]
Memory { used: usize, limit: usize },
/// Merge conflict between chunks (e.g. column type mismatch).
#[error("merge error: {0}")]
Merge(String),
/// Arrow array/batch construction failure.
#[error("Arrow error: {0}")]
Arrow(#[from] arrow::error::ArrowError),
/// Parser misbehavior: the parser returned invalid data.
#[error("parser error: {0}")]
Parser(String),
/// Lifetime violation: the parser returned a borrowed value that outlives the input.
#[error("lifetime error: {0}")]
Lifetime(String),
}
/// Shorthand result type used throughout the crate.
pub type Result<T> = std::result::Result<T, Error>;