projectglow / glow

An open-source toolkit for large-scale genomic analysis
https://projectglow.io
Apache License 2.0
262 stars 106 forks source link

Function to get quantiles of array #656

Closed henrydavidge closed 2 months ago

henrydavidge commented 2 months ago

What changes are proposed in this pull request?

Added function. Using interpolation method R7 from https://en.wikipedia.org/wiki/Quantile#Estimating_quantiles_from_a_sample. This is the same default as excel, R, and Julia.

How is this patch tested?

(Describe any other testing)

To run Spark 4.0 tests, add [SPARK4] to the pull request title.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 71.42857% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 92.31%. Comparing base (e08907f) to head (2c0ea4b).

Files Patch % Lines
core/src/main/scala/io/projectglow/functions.scala 0.00% 4 Missing :warning:
.../projectglow/sql/expressions/glueExpressions.scala 90.00% 1 Missing :warning:
python/glow/functions.py 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #656 +/- ## ========================================== - Coverage 92.37% 92.31% -0.06% ========================================== Files 127 127 Lines 7419 7440 +21 Branches 605 602 -3 ========================================== + Hits 6853 6868 +15 - Misses 566 572 +6 ``` | [Flag](https://app.codecov.io/gh/projectglow/glow/pull/656/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=projectglow) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/projectglow/glow/pull/656/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=projectglow) | `92.31% <71.42%> (-0.06%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=projectglow#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.