This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new a8f0d59de3 bugfix: correct regression on TableType for into_view
(#18617)
a8f0d59de3 is described below
commit a8f0d59de3ce74f921fce43ff8a1312f935f1b1e
Author: Tim Saucer <[email protected]>
AuthorDate: Tue Nov 11 14:32:23 2025 -0500
bugfix: correct regression on TableType for into_view (#18617)
## Which issue does this PR close?
https://github.com/apache/datafusion/pull/18158 introduced a regression
in the table type created with `DataFrame::into_view()`
## Rationale for this change
Correct regression
## What changes are included in this PR?
One line fix
## Are these changes tested?
Unit test added
## Are there any user-facing changes?
None
---
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 aab51efa1e..4a49dfb2ed 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]