xinlifoobar opened a new pull request, #10711:
URL: https://github.com/apache/datafusion/pull/10711
## 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 #123`
indicates that this PR will close issue #123.
-->
Closes #10626
## 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.
-->
## What changes are included in this PR?
Replace the `get_statatistics` macro by `get_statistics_iter` to pass the
whole iterator as argument and avoid the usage of intermediate `ScalarValue`.
Some improvements comparing to current `main` branch.
```bash
$ cargo bench --bench parquet_statistic -- --baseline main
Extract statistics for UInt64/extract_statistics/UInt64
time: [698.93 ns 699.44 ns 700.00 ns]
change: [-22.340% -22.130% -21.921%] (p = 0.00 <
0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) low severe
4 (4.00%) high mild
3 (3.00%) high severe
Extract statistics for F64/extract_statistics/F64
time: [1.0565 µs 1.0578 µs 1.0591 µs]
change: [-18.722% -18.049% -17.495%] (p = 0.00 <
0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
3 (3.00%) high mild
Extract statistics for String/extract_statistics/String
time: [1.4269 µs 1.4282 µs 1.4297 µs]
change: [-14.782% -13.611% -12.786%] (p = 0.00 <
0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) low severe
1 (1.00%) low mild
1 (1.00%) high mild
3 (3.00%) high severe
Extract statistics for Dictionary(Int32,
String)/extract_statistics/Dictionary(Int32, String)
time: [1.6035 µs 1.6051 µs 1.6066 µs]
change: [+0.5829% +3.2782% +5.6259%] (p = 0.01 <
0.05)
Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
7 (7.00%) low mild
3 (3.00%) high severe
```
<!--
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.
-->
## Are these changes tested?
<!--
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?
<!--
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.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]