From 52183ceb592e33a1aeb061f9583b81057092bca2 Mon Sep 17 00:00:00 2001 From: Smith Cruise Date: Sun, 13 Sep 2026 15:16:36 +0800 Subject: [PATCH] feat(datafusion): make IcebergTableProvider::try_new public IcebergTableProvider is the only provider with write support, but it has no public constructor: try_new and metadata_table are both pub(crate). The one public way to reach it is IcebergCatalogProvider::try_new, which eagerly lists every namespace and loads every table of the catalog, and takes over the whole CatalogProvider. Engines that bring their own catalog and schema providers cannot pay either cost, so make both methods pub. The struct and its TableProvider impl are already public; this adds no new types. Co-Authored-By: Claude Opus 5 --- crates/integrations/datafusion/public-api.txt | 6 ++++++ crates/integrations/datafusion/src/table/mod.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/integrations/datafusion/public-api.txt b/crates/integrations/datafusion/public-api.txt index 5fcb4e85d3..caa2cc27e0 100644 --- a/crates/integrations/datafusion/public-api.txt +++ b/crates/integrations/datafusion/public-api.txt @@ -71,6 +71,9 @@ pub fn iceberg_datafusion::IcebergStaticTableProvider::schema(&self) -> arrow_sc pub fn iceberg_datafusion::IcebergStaticTableProvider::supports_filters_pushdown(&self, filters: &[&datafusion_expr::expr::Expr]) -> datafusion_common::error::Result> pub fn iceberg_datafusion::IcebergStaticTableProvider::table_type(&self) -> datafusion_expr::table_source::TableType pub struct iceberg_datafusion::table::IcebergTableProvider +impl iceberg_datafusion::IcebergTableProvider +pub async fn iceberg_datafusion::IcebergTableProvider::metadata_table(&self, type: iceberg::inspect::metadata_table::MetadataTableType) -> iceberg::error::Result +pub async fn iceberg_datafusion::IcebergTableProvider::try_new(catalog: alloc::sync::Arc, namespace: iceberg::catalog::NamespaceIdent, name: impl core::convert::Into) -> iceberg::error::Result impl core::clone::Clone for iceberg_datafusion::IcebergTableProvider pub fn iceberg_datafusion::IcebergTableProvider::clone(&self) -> iceberg_datafusion::IcebergTableProvider impl core::fmt::Debug for iceberg_datafusion::IcebergTableProvider @@ -115,6 +118,9 @@ pub fn iceberg_datafusion::IcebergStaticTableProvider::schema(&self) -> arrow_sc pub fn iceberg_datafusion::IcebergStaticTableProvider::supports_filters_pushdown(&self, filters: &[&datafusion_expr::expr::Expr]) -> datafusion_common::error::Result> pub fn iceberg_datafusion::IcebergStaticTableProvider::table_type(&self) -> datafusion_expr::table_source::TableType pub struct iceberg_datafusion::IcebergTableProvider +impl iceberg_datafusion::IcebergTableProvider +pub async fn iceberg_datafusion::IcebergTableProvider::metadata_table(&self, type: iceberg::inspect::metadata_table::MetadataTableType) -> iceberg::error::Result +pub async fn iceberg_datafusion::IcebergTableProvider::try_new(catalog: alloc::sync::Arc, namespace: iceberg::catalog::NamespaceIdent, name: impl core::convert::Into) -> iceberg::error::Result impl core::clone::Clone for iceberg_datafusion::IcebergTableProvider pub fn iceberg_datafusion::IcebergTableProvider::clone(&self) -> iceberg_datafusion::IcebergTableProvider impl core::fmt::Debug for iceberg_datafusion::IcebergTableProvider diff --git a/crates/integrations/datafusion/src/table/mod.rs b/crates/integrations/datafusion/src/table/mod.rs index 9de7bcb9c2..4e71dc3efb 100644 --- a/crates/integrations/datafusion/src/table/mod.rs +++ b/crates/integrations/datafusion/src/table/mod.rs @@ -79,7 +79,7 @@ impl IcebergTableProvider { /// /// Loads the table once to get the initial schema, then stores the catalog /// reference for future metadata refreshes on each operation. - pub(crate) async fn try_new( + pub async fn try_new( catalog: Arc, namespace: NamespaceIdent, name: impl Into, @@ -97,7 +97,7 @@ impl IcebergTableProvider { }) } - pub(crate) async fn metadata_table( + pub async fn metadata_table( &self, r#type: MetadataTableType, ) -> Result {