Skip to content

Conversation

@delamarch3
Copy link
Contributor

@delamarch3 delamarch3 commented Dec 5, 2025

Which issue does this PR close?

Rationale for this change

Make the list file cache memory limit and TTL configurable via runtime config.

What changes are included in this PR?

  • Add ability to SET and RESET list_files_cache_limit and list_files_cache_ttl
  • list_files_cache_ttl will expect the duration to look like either 1m30s or 30 (I'm wondering if it would be simpler for it to just accept a single unit?)
  • Add update_cache_ttl() to the ListFilesCache trait so we can update it from RuntimeEnvBuilder::build()
  • Add config entries

Are these changes tested?

Yes

Are there any user-facing changes?

update_cache_ttl() has been added to the ListFilesCache trait

@github-actions github-actions bot added core Core DataFusion crate execution Related to the execution crate labels Dec 5, 2025
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Dec 5, 2025
@delamarch3 delamarch3 changed the title add config options for list_files_cache_limit and list_files_cache_ttl Add runtime config options for list_files_cache_limit and list_files_cache_ttl Dec 5, 2025
@delamarch3 delamarch3 marked this pull request as ready for review December 5, 2025 16:49
@delamarch3 delamarch3 marked this pull request as draft December 5, 2025 16:58
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 6, 2025
SELECT name FROM information_schema.df_settings WHERE name LIKE 'datafusion.runtime.%' ORDER BY name
----
datafusion.runtime.list_files_cache_limit
datafusion.runtime.list_files_cache_ttl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values for these will not update after running SET, unless the runtime has been configured with a ListFilesCache (it's None by default, so there is nothing to update)

@delamarch3 delamarch3 marked this pull request as ready for review December 8, 2025 12:11
@delamarch3
Copy link
Contributor Author

Hi @BlakeOrth @alamb, this is ready for review

Copy link
Contributor

@BlakeOrth BlakeOrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall looks very nice to me, thanks! Perhaps I'm missing it, but is there anyway to set the TTL back to infinity (None) after it's been set to Some(Duration)?

}
}

fn parse_duration(duration: &str) -> Result<Duration> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this method error if the input duration evaluates to 0s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that would make sense eaff9b5

@delamarch3
Copy link
Contributor Author

@BlakeOrth Yep, you can run reset datafusion.runtime.list_files_cache_ttl to set it back to None

Copy link
Contributor

@BlakeOrth BlakeOrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My approval doesn't have any real power here, but this all looks good to me. The CI failure seems like it's probably unrelated. I can't imagine this work having any effect on benchmarks.

@alamb
Copy link
Contributor

alamb commented Dec 10, 2025

Thanks @delamarch3 and @BlakeOrth -- I'll try and check this out soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate documentation Improvements or additions to documentation execution Related to the execution crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to dynamically configure / update the ListFilesCache settings via RuntimeConfiguration

3 participants