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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
use snafu::{Backtrace, Snafu};
use crate::{
coverage::{
EntityIdentityError, index_interval::IndexIntervalMappingError, io::CoverageSidecarError,
},
metadata::{index::IndexValueError, schema_compat::SchemaCompatibilityError},
};
/// Errors from table coverage queries and read-only coverage recovery.
#[derive(Debug, Snafu)]
#[snafu(visibility(pub(super)))]
#[non_exhaustive]
pub enum CoverageQueryError {
/// The requested half-open ordered-index range is invalid.
#[snafu(display("Invalid coverage query range: {source}"))]
InvalidRange {
/// Complete range validation error.
source: IndexValueError,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// An ordered value could not be mapped to its index interval ID.
#[snafu(display("Coverage query index interval mapping failed: {source}"))]
IndexIntervalMapping {
/// Complete interval mapping error.
source: IndexIntervalMappingError,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// Constructing a canonical entity identity failed.
#[snafu(display("Invalid coverage query entity identity: {source}"))]
InvalidEntityIdentity {
/// Complete entity identity construction error.
source: EntityIdentityError,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// The query identity is incompatible with the table schema.
#[snafu(display("Coverage query schema compatibility error: {source}"))]
SchemaCompatibility {
/// Complete schema compatibility error.
#[snafu(source(from(SchemaCompatibilityError, Box::new)), backtrace)]
source: Box<SchemaCompatibilityError>,
},
/// An identity-free query was used on an entity-aware table.
#[snafu(display(
"Entity identity is required for coverage queries; configured entity columns: {entity_columns:?}"
))]
EntityIdentityRequired {
/// Entity columns that require values from the caller.
entity_columns: Vec<String>,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// An entity-aware query was used on a table with global coverage.
#[snafu(display("Table has no configured entity columns"))]
EntityIdentityNotConfigured {
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// A required entity column has no caller-provided value.
#[snafu(display("Missing entity identity component for column {column}"))]
MissingEntityIdentityColumn {
/// Configured entity column missing from the caller input.
column: String,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// Caller input repeats one entity column.
#[snafu(display("Duplicate entity identity component for column {column}"))]
DuplicateEntityIdentityColumn {
/// Repeated entity column name.
column: String,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// Caller input contains a column outside the entity identity.
#[snafu(display("Unexpected entity identity component for column {column}"))]
UnexpectedEntityIdentityColumn {
/// Unknown entity column name.
column: String,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// Reading a table coverage snapshot sidecar failed.
#[snafu(display("Failed to read table coverage sidecar {coverage_path}: {source}"))]
CoverageSnapshotRead {
/// Table-relative sidecar path.
coverage_path: String,
/// Complete sidecar error, including storage or codec detail.
#[snafu(source(from(CoverageSidecarError, Box::new)), backtrace)]
source: Box<CoverageSidecarError>,
},
/// An existing segment has no coverage sidecar path.
#[snafu(display("Existing segment {segment_path} is missing coverage_path"))]
ExistingSegmentMissingCoverageMetadata {
/// Canonical segment path missing a coverage path.
segment_path: String,
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
/// Reading a segment sidecar failed during read-only recovery.
#[snafu(display(
"Failed to recover table coverage from segment {segment_path} sidecar {coverage_path}: {source}"
))]
SegmentCoverageSidecarRead {
/// Canonical segment path.
segment_path: String,
/// Table-relative sidecar path.
coverage_path: String,
/// Complete sidecar error, including storage or codec detail.
#[snafu(source(from(CoverageSidecarError, Box::new)), backtrace)]
source: Box<CoverageSidecarError>,
},
/// Table state has segments but no coverage snapshot pointer.
#[snafu(display("Table has segments but no table coverage snapshot pointer"))]
MissingTableCoveragePointer {
/// Backtrace captured at the coverage query boundary.
backtrace: Box<Backtrace>,
},
}