-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Limit the number of partition files to be displayed for FileGroupsDisplay #6359
Conversation
@@ -275,7 +286,9 @@ impl<'a> Display for FileGroupsDisplay<'a> { | |||
let mut first_group = true; | |||
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 |
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.
thats nice, thanks.
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.
👍
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 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
@@ -275,7 +286,9 @@ impl<'a> Display for FileGroupsDisplay<'a> { | |||
let mut first_group = true; | |||
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 |
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.
👍
I agree that we shouldn't print out the entire payload as part of the normal explain, so 👍. Adding this to a |
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.
I think this is good to go other than it needs a test. Thank you @yahoNanJing
@@ -297,6 +310,9 @@ impl<'a> Display for FileGroupsDisplay<'a> { | |||
} | |||
write!(f, "]")?; | |||
} | |||
if self.0.len() > max_groups { | |||
write!(f, ", ...")?; | |||
} | |||
write!(f, "]}}")?; | |||
Ok(()) | |||
} |
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.
Is there any way we can write a test for this code? So we don't break it in the future?
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?