Skip to content

Commit 5c743d7

Browse files
authored
[branch-51] bugfix: correct regression on TableType in into_view in DF51 (#18618)
This is the same as #18617 but targeted at the DF-51 release branch
1 parent 49e347b commit 5c743d7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

datafusion/core/src/dataframe/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ impl DataFrame {
16551655
pub fn into_view(self) -> Arc<dyn TableProvider> {
16561656
Arc::new(DataFrameTableProvider {
16571657
plan: self.plan,
1658-
table_type: TableType::Temporary,
1658+
table_type: TableType::View,
16591659
})
16601660
}
16611661

datafusion/core/tests/dataframe/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,9 @@ async fn register_table() -> Result<()> {
16271627
let df_impl = DataFrame::new(ctx.state(), df.logical_plan().clone());
16281628

16291629
// register a dataframe as a table
1630-
ctx.register_table("test_table", df_impl.clone().into_view())?;
1630+
let table_provider = df_impl.clone().into_view();
1631+
assert_eq!(table_provider.table_type(), TableType::View);
1632+
ctx.register_table("test_table", table_provider)?;
16311633

16321634
// pull the table out
16331635
let table = ctx.table("test_table").await?;

0 commit comments

Comments
 (0)