You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/07 14:40:07 UTC
[GitHub] [arrow-datafusion] andygrove opened a new pull request, #3064: Simplify `approx_median` implementation
andygrove opened a new pull request, #3064:
URL: https://github.com/apache/arrow-datafusion/pull/3064
# 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 https://github.com/apache/arrow-datafusion/issues/3063
# 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.
-->
I started down this rabbit hole when trying to expose `ApproxMedian` in Python and found that it called `unimplemented!` in its accumulator. DataFusion supports `approx_median` in SQL becausethe SQL query planner translates `approx_median(expr)` to `approx_percentile_cont(expr, 0.5)`.
# 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.
-->
- Implement `ApproxMedian` (by delegating to `ApproxPercentileCont`)
- Add `pub fn approx_median` so that it is now possible to use this from DataFrames
- Remove the logic from the SQL query planner that was translating these functions
- Add a new test
- Update some existing test because the plan now correctly shows `APPROXMEDIAN` instead of `APPROXPERCENTILECONT`
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
Yes - the plans look different
<!--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] andygrove commented on pull request #3064: Simplify `approx_median` implementation
Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #3064:
URL: https://github.com/apache/arrow-datafusion/pull/3064#issuecomment-1207428254
@realno @alamb @matthewmturner @korowa fyi
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] ursabot commented on pull request #3064: Simplify `approx_median` implementation, expose via `DataFrame` API
Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3064:
URL: https://github.com/apache/arrow-datafusion/pull/3064#issuecomment-1208067291
Benchmark runs are scheduled for baseline = 6e6f3bf9dec82b332e21f11699552c34f72493ac and contender = 48a824650a2175a51e2be5e33127bbca6c266b9b. 48a824650a2175a51e2be5e33127bbca6c266b9b is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/0c52d33a4cb54f87b93a6d5567cb0617...d1f4a9510ae44671a55a22f5dd0e09ef/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/63dd871fe2ff4d24b7bce90ac06230d3...62dc01dc60ed4721844670866e76ad6e/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/182dc179a58f49debb905ea7c7ca07b0...993eebca387e4b3582b7ac19d3f1231a/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/8ba8dbe62dbe493a85fc89d50b57f32d...717cde31ea1a4ef39ad7bc5f4d785216/)
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
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb merged pull request #3064: Simplify `approx_median` implementation
Posted by GitBox <gi...@apache.org>.
alamb merged PR #3064:
URL: https://github.com/apache/arrow-datafusion/pull/3064
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] codecov-commenter commented on pull request #3064: Simplify `approx_median` implementation
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3064:
URL: https://github.com/apache/arrow-datafusion/pull/3064#issuecomment-1207427964
# [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/3064?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#3064](https://codecov.io/gh/apache/arrow-datafusion/pull/3064?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f9bbe4b) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/0e0931de0fbfcf00a0443adb0626f1f9cf9bdc76?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0e0931d) will **increase** coverage by `0.01%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #3064 +/- ##
==========================================
+ Coverage 85.85% 85.86% +0.01%
==========================================
Files 289 289
Lines 51890 51902 +12
==========================================
+ Hits 44548 44567 +19
+ Misses 7342 7335 -7
```
| [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/3064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [datafusion/core/tests/dataframe\_functions.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3064/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9jb3JlL3Rlc3RzL2RhdGFmcmFtZV9mdW5jdGlvbnMucnM=) | `100.00% <100.00%> (ø)` | |
| [datafusion/expr/src/expr\_fn.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3064/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9leHByL3NyYy9leHByX2ZuLnJz) | `90.80% <100.00%> (+0.10%)` | :arrow_up: |
| [...usion/physical-expr/src/aggregate/approx\_median.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3064/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1leHByL3NyYy9hZ2dyZWdhdGUvYXBwcm94X21lZGlhbi5ycw==) | `100.00% <100.00%> (+36.36%)` | :arrow_up: |
| [datafusion/physical-expr/src/aggregate/build\_in.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3064/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1leHByL3NyYy9hZ2dyZWdhdGUvYnVpbGRfaW4ucnM=) | `89.92% <100.00%> (ø)` | |
| [datafusion/sql/src/planner.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3064/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9zcWwvc3JjL3BsYW5uZXIucnM=) | `81.93% <100.00%> (-0.02%)` | :arrow_down: |
| [datafusion/expr/src/logical\_plan/plan.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/3064/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9leHByL3NyYy9sb2dpY2FsX3BsYW4vcGxhbi5ycw==) | `77.77% <0.00%> (+0.34%)` | :arrow_up: |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. [Learn more](https://about.codecov.io/product/feature/runtime-insights/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org