Skip to content

Commit 45c7157

Browse files
committed
Seperate drop table clean-ups
1 parent ddbccf2 commit 45c7157

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

  • datafusion/core/src/execution/context

datafusion/core/src/execution/context/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,17 +1425,16 @@ impl SessionContext {
14251425
&& table_provider.table_type() == table_type
14261426
{
14271427
schema.deregister_table(&table)?;
1428-
if table_type == TableType::Base
1429-
&& let Some(lfc) = self.runtime_env().cache_manager.get_list_files_cache()
1430-
&& let Some(fsc) =
1431-
self.runtime_env().cache_manager.get_file_statistic_cache()
1432-
{
1433-
lfc.drop_table_entries(&Some(table_ref.clone()))?;
1434-
fsc.drop_table_entries(&Some(table_ref.clone()))?;
1428+
if table_type == TableType::Base {
1429+
if let Some(lfc) = self.runtime_env().cache_manager.get_list_files_cache() {
1430+
lfc.drop_table_entries(&Some(table_ref.clone()))?;
1431+
}
1432+
if let Some(fsc) = self.runtime_env().cache_manager.get_file_statistic_cache() {
1433+
fsc.drop_table_entries(&Some(table_ref.clone()))?;
1434+
}
1435+
return Ok(true);
14351436
}
1436-
return Ok(true);
14371437
}
1438-
14391438
Ok(false)
14401439
}
14411440

0 commit comments

Comments
 (0)