datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

some statistical aggregate functions don't accept decimal numeric types

Open kmitchener opened this issue 3 years ago • 0 comments

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.

kmitchener avatar Sep 14 '22 13:09 kmitchener