-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Enables DefaultListFilesCache by default #19366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
73c6672
Enables DefaultListFilesCache by default
BlakeOrth da08e25
- Better formatting and additional information for docs
BlakeOrth ab4c602
Merge branch 'apache:main' into feature/enable_list_cache
BlakeOrth de5ec9f
- Updates more tests for caching improvements from upstream updates
BlakeOrth 80f7d63
Merge branch 'main' into feature/enable_list_cache
alamb fef57a3
Merge branch 'main' into feature/enable_list_cache
BlakeOrth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,15 +45,26 @@ directly on the `Field`. For example: | |
| In prior versions, `ListingTableProvider` would issue `LIST` commands to | ||
| the underlying object store each time it needed to list files for a query. | ||
| To improve performance, `ListingTableProvider` now caches the results of | ||
| `LIST` commands for the lifetime of the `ListingTableProvider` instance. | ||
| `LIST` commands for the lifetime of the `ListingTableProvider` instance or | ||
| until a cache entry expires. | ||
|
|
||
| Note that by default the cache has no expiration time, so if files are added or removed | ||
| from the underlying object store, the `ListingTableProvider` will not see | ||
| those changes until the `ListingTableProvider` instance is dropped and recreated. | ||
|
|
||
| You will be able to configure the maximum cache size and cache expiration time via a configuration option: | ||
| You can configure the maximum cache size and cache entry expiration time via configuration options: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
|
||
| See <https://github.com/apache/datafusion/issues/19056> for more details. | ||
| - `datafusion.runtime.list_files_cache_limit` - Limits the size of the cache in bytes | ||
| - `datafusion.runtime.list_files_cache_ttl` - Limits the TTL (time-to-live) of an entry in seconds | ||
|
|
||
| Detailed configuration information can be found in the [DataFusion Runtime | ||
| Configuration](https://datafusion.apache.org/user-guide/configs.html#runtime-configuration-settings) user's guide. | ||
|
|
||
| Caching can be disabled by setting the limit to 0: | ||
|
|
||
| ```sql | ||
| SET datafusion.runtime.list_files_cache_limit TO "0K"; | ||
| ``` | ||
|
|
||
| Note that the internal API has changed to use a trait `ListFilesCache` instead of a type alias. | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user has disabled caching with
list_files_cache_limit = "0K"thenNonewill be returned here, but in this caseget_list_files_cache_limit()will return "1M"