Skip to content
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

Merged
merged 1 commit into from
May 18, 2023

Conversation

yahoNanJing
Copy link
Contributor

@yahoNanJing yahoNanJing commented May 16, 2023

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?

@github-actions github-actions bot added the core Core DataFusion crate label May 16, 2023
@yahoNanJing yahoNanJing requested a review from alamb May 16, 2023 05:18
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

thats nice, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@alamb alamb left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@crepererum
Copy link
Contributor

I agree that we shouldn't print out the entire payload as part of the normal explain, so 👍. Adding this to a EXPLAIN VERBOSE output would be nice though.

Copy link
Contributor

@alamb alamb left a 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(())
}
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit the number of partition files to be displayed for FileGroupsDisplay
5 participants