This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch branch-51
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/branch-51 by this push:
     new 5c743d7660 [branch-51] bugfix: correct regression on TableType in 
into_view in DF51 (#18618)
5c743d7660 is described below

commit 5c743d766068a89dbaa7c624d2eb0c1553b50c42
Author: Tim Saucer <[email protected]>
AuthorDate: Tue Nov 11 14:31:44 2025 -0500

    [branch-51] bugfix: correct regression on TableType in into_view in DF51 
(#18618)
    
    This is the same as https://github.com/apache/datafusion/pull/18617 but
    targeted at the DF-51 release branch
---
 datafusion/core/src/dataframe/mod.rs   | 2 +-
 datafusion/core/tests/dataframe/mod.rs | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/datafusion/core/src/dataframe/mod.rs 
b/datafusion/core/src/dataframe/mod.rs
index 98804e424b..b43c9c671f 100644
--- a/datafusion/core/src/dataframe/mod.rs
+++ b/datafusion/core/src/dataframe/mod.rs
@@ -1655,7 +1655,7 @@ impl DataFrame {
     pub fn into_view(self) -> Arc<dyn TableProvider> {
         Arc::new(DataFrameTableProvider {
             plan: self.plan,
-            table_type: TableType::Temporary,
+            table_type: TableType::View,
         })
     }
 
diff --git a/datafusion/core/tests/dataframe/mod.rs 
b/datafusion/core/tests/dataframe/mod.rs
index 05f5a204c0..e221edb7c5 100644
--- a/datafusion/core/tests/dataframe/mod.rs
+++ b/datafusion/core/tests/dataframe/mod.rs
@@ -1627,7 +1627,9 @@ async fn register_table() -> Result<()> {
     let df_impl = DataFrame::new(ctx.state(), df.logical_plan().clone());
 
     // register a dataframe as a table
-    ctx.register_table("test_table", df_impl.clone().into_view())?;
+    let table_provider = df_impl.clone().into_view();
+    assert_eq!(table_provider.table_type(), TableType::View);
+    ctx.register_table("test_table", table_provider)?;
 
     // pull the table out
     let table = ctx.table("test_table").await?;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to