Skip to content

Commit f468ae7

Browse files
committed
make catalog trait object available from datafusion iceberg catalog
1 parent d092844 commit f468ae7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

datafusion_iceberg/src/catalog/catalog.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ impl IcebergCatalog {
1818
catalog: Arc::new(Mirror::new(catalog, branch.map(ToOwned::to_owned)).await?),
1919
})
2020
}
21+
22+
pub fn catalog(&self) -> &dyn Catalog {
23+
self.catalog.catalog()
24+
}
2125
}
2226

2327
impl CatalogProvider for IcebergCatalog {

datafusion_iceberg/src/catalog/mirror.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use dashmap::DashMap;
22
use datafusion::{datasource::TableProvider, error::DataFusionError};
33
use futures::{executor::LocalPool, task::LocalSpawnExt};
4+
use std::ops::Deref;
45
use std::{collections::HashSet, sync::Arc};
56

67
use iceberg_rust::spec::{tabular::TabularMetadata, view_metadata::REF_PREFIX};
@@ -304,4 +305,8 @@ impl Mirror {
304305
// Currently can't synchronously return a table which has to be fetched asynchronously
305306
Ok(None)
306307
}
308+
309+
pub fn catalog(&self) -> &dyn Catalog {
310+
self.catalog.deref()
311+
}
307312
}

0 commit comments

Comments
 (0)