datafusion
datafusion copied to clipboard
some statistical aggregate functions don't accept decimal numeric types
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
All these tests fail when given decimal inputs:
sql::aggregates::csv_query_approx_percentile_cont
sql::aggregates::csv_query_approx_percentile_cont_with_histogram_bins
sql::aggregates::csv_query_approx_percentile_cont_with_weight
sql::aggregates::csv_query_stddev_6
with errors similar to
called `Result::unwrap()` on an `Err` value: "Plan(\"The percentile argument for ApproxPercentileCont must be Float64, not Decimal128(2, 1).\")
Expected behavior A clear and concise description of what you expected to happen.
To match Postgres behavior, these functions should take any numeric input and have differing return types depending on input:
- var / var_samp / var_pop
- stddev / stddev_samp / stddev_pop
Additional context Add any other context about the problem here.