Limit the number of partition files to be displayed for FileGroupsDisplay#6359
Merged
yahoNanJing merged 1 commit intoapache:mainfrom May 18, 2023
Merged
Limit the number of partition files to be displayed for FileGroupsDisplay#6359yahoNanJing merged 1 commit intoapache:mainfrom
yahoNanJing merged 1 commit intoapache:mainfrom
Conversation
comphead
reviewed
May 16, 2023
| let groups = if self.0.len() == 1 { "group" } else { "groups" }; | ||
| write!(f, "{{{} {}: [", self.0.len(), groups)?; | ||
| for group in self.0 { | ||
| // To avoid showing too many partitions |
alamb
approved these changes
May 16, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
This looks like a nice change to me -- thank you @yahoNanJing
What do you think about showing all the groups when the user does explain verbose?
It seem like seeing all the files may still be helpful
If you agree, we can add that feature as a follow on PR.
cc @crepererum for your thoughts
| let groups = if self.0.len() == 1 { "group" } else { "groups" }; | ||
| write!(f, "{{{} {}: [", self.0.len(), groups)?; | ||
| for group in self.0 { | ||
| // To avoid showing too many partitions |
Contributor
|
I agree that we shouldn't print out the entire payload as part of the normal explain, so 👍. Adding this to a |
alamb
reviewed
May 17, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
I think this is good to go other than it needs a test. Thank you @yahoNanJing
| } | ||
| write!(f, "]}}")?; | ||
| Ok(()) | ||
| } |
Contributor
There was a problem hiding this comment.
Is there any way we can write a test for this code? So we don't break it in the future?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Closes #6358.
Rationale for this change
When a sql needs to hit thousands of files, the content of thousands of partition files shown by the FileGroupsDisplay is too much.
What changes are included in this PR?
Only at most 5 of them will be shown. Others will be replaced by
...Are these changes tested?
Are there any user-facing changes?