Commit ff38480
authored
Refactor
## 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.
-->
- Related to #18092
## 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.
-->
Current signature for `percentile_cont` is quite confusing in what types
it accepts. Currently the code suggests it accepts all numeric types,
where floats & decimals are maintained as is, integers are cast to
float64 internally. However this is misleading as `NUMERICS` does not
contain decimals, so currently everything is cast to float.
Clean up the code to make this more clear and do various other
refactors.
## 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.
-->
Use coercion signature to have type coercion coerce types to float so we
can remove internal code related to casting to float or handling
non-float types.
Various other refactors.
## 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)?
-->
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.
-->
No.
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->percentile_cont to clarify support input types (#19611)1 parent 2d56253 commit ff38480
File tree
2 files changed
+159
-270
lines changed- datafusion
- functions-aggregate/src
- sqllogictest/test_files
2 files changed
+159
-270
lines changed
0 commit comments