kosiew commented on code in PR #20047:
URL: https://github.com/apache/datafusion/pull/20047#discussion_r3212246881
##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -1420,14 +1429,19 @@ impl SessionContext {
&& table_provider.table_type() == table_type
{
schema.deregister_table(&table)?;
- if table_type == TableType::Base
- && let Some(lfc) =
self.runtime_env().cache_manager.get_list_files_cache()
- {
- lfc.drop_table_entries(&Some(table_ref))?;
+ if table_type == TableType::Base {
+ if let Some(lfc) =
self.runtime_env().cache_manager.get_list_files_cache()
+ {
+ lfc.drop_table_entries(&Some(table_ref.clone()))?;
+ }
+ if let Some(fsc) =
+ self.runtime_env().cache_manager.get_file_statistic_cache()
+ {
Review Comment:
Nice improvement adding cache cleanup through `find_and_deregister()`. One
thing still missing though is the public `SessionContext::deregister_table()`
path.
Right now `register_listing_table()` can populate table-scoped list-files
and file-statistics cache entries, but calling the public `deregister_table()`
API only removes the provider and leaves those cache entries behind.
That means API users can still end up with stale table-scoped entries
visible in cache introspection until they age out via LRU eviction.
Could we mirror the same cleanup logic used in `find_and_deregister()` here
by removing entries from both `get_list_files_cache()` and
`get_file_statistic_cache()` after a successful deregistration?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]