Skip to content

Commit a72aae6

Browse files
committed
scan: create TableWithoutSnapshot error
1 parent 8a3de4e commit a72aae6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/iceberg/src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ pub enum ErrorKind {
4444
///
4545
/// This error is returned when given iceberg feature is not supported.
4646
FeatureUnsupported,
47+
/// Iceberg table don't have any snapshot to scan
48+
///
49+
/// This error is returned when a table scan is attempt to executed on table
50+
/// without snapshots.
51+
TableWithoutSnapshot,
4752
}
4853

4954
impl ErrorKind {
@@ -59,6 +64,7 @@ impl From<ErrorKind> for &'static str {
5964
ErrorKind::Unexpected => "Unexpected",
6065
ErrorKind::DataInvalid => "DataInvalid",
6166
ErrorKind::FeatureUnsupported => "FeatureUnsupported",
67+
ErrorKind::TableWithoutSnapshot => "TableWithoutSnapshot",
6268
}
6369
}
6470
}

crates/iceberg/src/scan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<'a> TableScanBuilder<'a> {
177177
.current_snapshot()
178178
.ok_or_else(|| {
179179
Error::new(
180-
ErrorKind::FeatureUnsupported,
180+
ErrorKind::TableWithoutSnapshot,
181181
"Can't scan table without snapshots",
182182
)
183183
})?

0 commit comments

Comments
 (0)