Commit 87483b4 1 parent 984c91e commit 87483b4 Copy full SHA for 87483b4
File tree 2 files changed +9
-1
lines changed
crates/integrations/datafusion/src
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -24,3 +24,4 @@ pub use error::*;
24
24
mod physical_plan;
25
25
mod schema;
26
26
mod table;
27
+ pub use table:: * ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ use crate::physical_plan::scan::IcebergTableScan;
33
33
34
34
/// Represents a [`TableProvider`] for the Iceberg [`Catalog`],
35
35
/// managing access to a [`Table`].
36
- pub ( crate ) struct IcebergTableProvider {
36
+ pub struct IcebergTableProvider {
37
37
/// A table in the catalog.
38
38
table : Table ,
39
39
/// A reference-counted arrow `Schema`.
@@ -56,6 +56,13 @@ impl IcebergTableProvider {
56
56
57
57
Ok ( IcebergTableProvider { table, schema } )
58
58
}
59
+
60
+ /// Asynchronously tries to construct a new [`IcebergTableProvider`]
61
+ /// using the given table. Can be used to create a table provider from an existing table regardless of the catalog implementation.
62
+ pub async fn try_new_from_table ( table : Table ) -> Result < Self > {
63
+ let schema = Arc :: new ( schema_to_arrow_schema ( table. metadata ( ) . current_schema ( ) ) ?) ;
64
+ Ok ( IcebergTableProvider { table, schema } )
65
+ }
59
66
}
60
67
61
68
#[ async_trait]
You can’t perform that action at this time.
0 commit comments