jizezhang opened a new issue, #19396:
URL: https://github.com/apache/datafusion/issues/19396

   ### Describe the bug
   
   If user creates a `ListFilesCache` with `ttl` set, e.g. 
`DefaultListFilesCache::new(1024, Some(Duration::from_secs(1))`, but does not 
set `CacheManagerConfig::list_files_cache_ttl`, `ttl` in the `list_files_cache` 
would be unset.
   
   ### To Reproduce
   
   ```
   use std::{sync::Arc, time::Duration};
   
   use datafusion_execution::cache::{
       DefaultListFilesCache,
       cache_manager::{CacheManager, CacheManagerConfig},
   };
   
   fn main() {
       let list_file_cache = DefaultListFilesCache::new(1024, 
Some(Duration::from_secs(1)));
   
       let config =
           
CacheManagerConfig::default().with_list_files_cache(Some(Arc::new(list_file_cache)));
   
       let cache_manager = CacheManager::try_new(&config).unwrap();
   
       // check on is_some() would fail
       assert!(
           cache_manager
               .get_list_files_cache()
               .unwrap()
               .cache_ttl()
               .is_some()
       );
   }
   ```
   with `Cargo.toml`
   ```
   [package]
   name = "list-cache"
   version = "0.1.0"
   edition = "2024"
   
   [dependencies]
   datafusion-execution = "51.0.0"
   
   [patch.crates-io]
   datafusion-execution = { path = '../../datafusion/datafusion/execution' }
   ```
   
   ### Expected behavior
   
   `ttl` from `DefaultListFilesCache` is preserved.
   
   ### Additional context
   
   Some discussion here 
https://github.com/apache/datafusion/issues/19055#issuecomment-3671194579


-- 
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]

Reply via email to