minor: Fix parquet pruning metrics display order#18379
minor: Fix parquet pruning metrics display order#183792010YOUY01 merged 3 commits intoapache:mainfrom
Conversation
| Self::PruningMetrics { name, .. } => match name.as_ref() { | ||
| // The order is the same as the actual pruning order: from | ||
| // coarse-grained to fine-grained pruning levels. | ||
| "files_ranges_pruned_statistics" => 3, |
There was a problem hiding this comment.
It's a little bit hacky 🤔 but I think this way is simpler and easy to update.
There was a problem hiding this comment.
maybe a comment could help / ticket to assist others who find this code and are confused by it
There was a problem hiding this comment.
Good idea, comments added.
comphead
left a comment
There was a problem hiding this comment.
Thanks @2010YOUY01
just 1 thing, if the name is changed for example from files_ranges_pruned_statistics to files_ranges_pruned_statistics_other in project but not in value.rs will the test detect it and fail?
Yes, the UT in this PR will catch such changes. |
alamb
left a comment
There was a problem hiding this comment.
Thanks @2010YOUY01 -- the metrics just keep getting better!
| Self::PruningMetrics { name, .. } => match name.as_ref() { | ||
| // The order is the same as the actual pruning order: from | ||
| // coarse-grained to fine-grained pruning levels. | ||
| "files_ranges_pruned_statistics" => 3, |
There was a problem hiding this comment.
maybe a comment could help / ticket to assist others who find this code and are confused by it
|
Thank you both for the review! |
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes #. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> It's better to let pruning metrics in parquet displayed in an order that is the same as the actual pruning order: ``` metrics=...files_ranges_pruned_statistics=21 total → 3 matched, row_groups_pruned_statistics=1 total → 1 matched, row_groups_pruned_bloom_filter=1 total → 1 matched, page_index_rows_pruned=748901 total → 19813 matched... ``` Now it's ordered alphabetically. See apache#18321 (comment) for reproducing. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> Update the sort key API in `MetricValue`, to let the parquet pruning metrics display in the expected order. ## Are these changes tested? UT <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? No <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes #. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> It's better to let pruning metrics in parquet displayed in an order that is the same as the actual pruning order: ``` metrics=...files_ranges_pruned_statistics=21 total → 3 matched, row_groups_pruned_statistics=1 total → 1 matched, row_groups_pruned_bloom_filter=1 total → 1 matched, page_index_rows_pruned=748901 total → 19813 matched... ``` Now it's ordered alphabetically. See apache#18321 (comment) for reproducing. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> Update the sort key API in `MetricValue`, to let the parquet pruning metrics display in the expected order. ## Are these changes tested? UT <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? No <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
Which issue does this PR close?
Rationale for this change
It's better to let pruning metrics in parquet displayed in an order that is the same as the actual pruning order:
Now it's ordered alphabetically.
See #18321 (comment) for reproducing.
What changes are included in this PR?
Update the sort key API in
MetricValue, to let the parquet pruning metrics display in the expected order.Are these changes tested?
UT
Are there any user-facing changes?
No