-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Implement the statistics_cache function
#19054
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
14 commits
Select commit
Hold shift + click to select a range
ab30e28
feat: Implement statistics_cache function
nuno-faria 1a4596d
Fix warnings
nuno-faria fd4748a
Update docs/source/user-guide/cli/functions.md
nuno-faria 3ecbd51
Update docs/source/user-guide/cli/functions.md
nuno-faria 03bc0a7
Move doc before derive
nuno-faria c1c0fb4
Merge branch 'main' into statistics_cache_function
nuno-faria 57c0dda
Fix warnings
nuno-faria 49307af
Add a test showing nothing in the statistics cache with default sessi…
alamb 488e1c4
more comments
alamb fc98396
Merge remote-tracking branch 'apache/main' into statistics_cache_func…
alamb 6bdb158
Fix up merge
alamb 53e73d8
Merge remote-tracking branch 'apache/main' into statistics_cache_func…
alamb 627ce48
Update expected
alamb 686c872
Merge branch 'main' into statistics_cache_function
alamb 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,7 +178,7 @@ pub struct ListingTable { | |
| /// The SQL definition for this table, if any | ||
| definition: Option<String>, | ||
| /// Cache for collected file statistics | ||
| collected_statistics: FileStatisticsCache, | ||
| collected_statistics: Arc<dyn FileStatisticsCache>, | ||
| /// Constraints applied to this table | ||
| constraints: Constraints, | ||
| /// Column default expressions for columns that are not physically present in the data files | ||
|
|
@@ -255,7 +255,7 @@ impl ListingTable { | |
| /// multiple times in the same session. | ||
| /// | ||
| /// If `None`, creates a new [`DefaultFileStatisticsCache`] scoped to this query. | ||
| pub fn with_cache(mut self, cache: Option<FileStatisticsCache>) -> Self { | ||
| pub fn with_cache(mut self, cache: Option<Arc<dyn FileStatisticsCache>>) -> Self { | ||
|
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. technically this is an API change, but I think it is a good one and makes the FileStatisticsCache consistent with the rest-- will mark the PR as API change |
||
| self.collected_statistics = | ||
| cache.unwrap_or_else(|| Arc::new(DefaultFileStatisticsCache::default())); | ||
| self | ||
|
|
||
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
Oops, something went wrong.
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.
This will not be necessary after #19217