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

Improve parquet partition_file output display #4467

Merged
merged 7 commits into from
Dec 4, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 1, 2022

Which issue does this PR close?

Closes #4466

Rationale for this change

See #4466

What changes are included in this PR?

Improve the formatting for Vec<Vec<PartitionFile>>

Are these changes tested?

Yes

Are there any user-facing changes?

better explain output

@github-actions github-actions bot added the core Core DataFusion crate label Dec 1, 2022
}

#[test]
fn file_groups_display() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prior to the changes in this PR, this was displayed as "[foo, bar, baz, ]"

I think this PR is much clearer

@@ -183,17 +183,27 @@ struct FileGroupsDisplay<'a>(&'a [Vec<PartitionedFile>]);

impl<'a> Display for FileGroupsDisplay<'a> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This implementation also avoids allocating strings and Vecs, which I don't think is a particularly important feature, but it is a nice benefit.

@alamb alamb force-pushed the alamb/file_group_display branch from 88e42a7 to efab485 Compare December 1, 2022 19:38
Copy link
Contributor Author

@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.

cc @rdettai who I believe contributed the original formatting code

@@ -696,7 +696,7 @@ async fn test_physical_plan_display_indent() {
" CoalesceBatchesExec: target_batch_size=4096",
" FilterExec: c12@1 < 10",
" RepartitionExec: partitioning=RoundRobinBatch(9000)",
" CsvExec: files=[ARROW_TEST_DATA/csv/aggregate_test_100.csv], has_header=true, limit=None, projection=[c1, c12]",
" CsvExec: files=1:[[ARROW_TEST_DATA/csv/aggregate_test_100.csv]], has_header=true, limit=None, projection=[c1, c12]",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried several variations on this formatting to show the file names as well as the number of partitions

Other thoughts?
maybe adding a brace and a key?

Suggested change
" CsvExec: files=1:[[ARROW_TEST_DATA/csv/aggregate_test_100.csv]], has_header=true, limit=None, projection=[c1, c12]",
" CsvExec: files={groups:1, [[ARROW_TEST_DATA/csv/aggregate_test_100.csv]]}, has_header=true, limit=None, projection=[c1, c12]",

Copy link
Contributor

Choose a reason for hiding this comment

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

Since you only spell out groups once, I think it could be very helpful to spell this out.

@alamb alamb marked this pull request as ready for review December 1, 2022 19:51
Copy link
Contributor

@crepererum crepererum left a comment

Choose a reason for hiding this comment

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

Like this very much. Would prefer the slightly more verbose version, but that's not a blocker.

@@ -696,7 +696,7 @@ async fn test_physical_plan_display_indent() {
" CoalesceBatchesExec: target_batch_size=4096",
" FilterExec: c12@1 < 10",
" RepartitionExec: partitioning=RoundRobinBatch(9000)",
" CsvExec: files=[ARROW_TEST_DATA/csv/aggregate_test_100.csv], has_header=true, limit=None, projection=[c1, c12]",
" CsvExec: files=1:[[ARROW_TEST_DATA/csv/aggregate_test_100.csv]], has_header=true, limit=None, projection=[c1, c12]",
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you only spell out groups once, I think it could be very helpful to spell this out.

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

I like the idea of explicitly identifying what the integer represents, the partition count, but equally this is an improvement already so approving 👍

@alamb
Copy link
Contributor Author

alamb commented Dec 3, 2022

I have changed it to be

partitions={1 group: [[x]]}

Which I think is better

Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

Let's merge! A nice improvement

@xudong963 xudong963 merged commit df41267 into apache:master Dec 4, 2022
@ursabot
Copy link

ursabot commented Dec 4, 2022

Benchmark runs are scheduled for baseline = 156a594 and contender = df41267. df41267 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@alamb alamb deleted the alamb/file_group_display branch December 4, 2022 11:55
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.

Improve partition file explain plan display to show groupings
5 participants