diff --git a/crates/integrations/datafusion/src/lib.rs b/crates/integrations/datafusion/src/lib.rs index 2316d2b774..09d1cac4ce 100644 --- a/crates/integrations/datafusion/src/lib.rs +++ b/crates/integrations/datafusion/src/lib.rs @@ -21,7 +21,7 @@ pub use catalog::*; mod error; pub use error::*; -mod physical_plan; +pub mod physical_plan; mod schema; pub mod table; pub use table::table_provider_factory::IcebergTableProviderFactory; diff --git a/crates/integrations/datafusion/src/physical_plan/mod.rs b/crates/integrations/datafusion/src/physical_plan/mod.rs index 58fb065dde..e424b690bc 100644 --- a/crates/integrations/datafusion/src/physical_plan/mod.rs +++ b/crates/integrations/datafusion/src/physical_plan/mod.rs @@ -18,3 +18,4 @@ pub(crate) mod expr_to_predicate; pub(crate) mod metadata_scan; pub(crate) mod scan; +pub use scan::IcebergTableScan; diff --git a/crates/integrations/datafusion/src/physical_plan/scan.rs b/crates/integrations/datafusion/src/physical_plan/scan.rs index f33437eec7..d4751a19c8 100644 --- a/crates/integrations/datafusion/src/physical_plan/scan.rs +++ b/crates/integrations/datafusion/src/physical_plan/scan.rs @@ -39,7 +39,7 @@ use crate::to_datafusion_error; /// Manages the scanning process of an Iceberg [`Table`], encapsulating the /// necessary details and computed properties required for execution planning. #[derive(Debug)] -pub(crate) struct IcebergTableScan { +pub struct IcebergTableScan { /// A table in the catalog. table: Table, /// Snapshot of the table to scan. @@ -79,6 +79,22 @@ impl IcebergTableScan { } } + pub fn table(&self) -> &Table { + &self.table + } + + pub fn snapshot_id(&self) -> Option { + self.snapshot_id + } + + pub fn projection(&self) -> Option<&[String]> { + self.projection.as_deref() + } + + pub fn predicates(&self) -> Option<&Predicate> { + self.predicates.as_ref() + } + /// Computes [`PlanProperties`] used in query optimization. fn compute_properties(schema: ArrowSchemaRef) -> PlanProperties { // TODO: