Skip to content

Commit 168f7c1

Browse files
Fix RestCatalog::tabular_exists
1 parent 129c819 commit 168f7c1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

catalogs/iceberg-rest-catalog/src/catalog.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl Catalog for RestCatalog {
199199
}
200200
/// Check if a table exists
201201
async fn tabular_exists(&self, identifier: &Identifier) -> Result<bool, Error> {
202-
catalog_api_api::view_exists(
202+
match catalog_api_api::view_exists(
203203
&self.configuration,
204204
self.name.as_deref(),
205205
&identifier.namespace().to_string(),
@@ -215,8 +215,11 @@ impl Catalog for RestCatalog {
215215
.await
216216
})
217217
.await
218-
.map(|_| true)
219-
.map_err(Into::<Error>::into)
218+
.map_err(Into::<Error>::into) {
219+
Ok(_) => Ok(true),
220+
Err(Error::NotFound(_)) => Ok(false),
221+
Err(e) => Err(e),
222+
}
220223
}
221224
/// Drop a table and delete all data and metadata files.
222225
async fn drop_table(&self, identifier: &Identifier) -> Result<(), Error> {

0 commit comments

Comments
 (0)