Skip to content

Wrong result with quantiles and NaN #17725

@mauropagano

Description

@mauropagano

What happens?

When trying to get a quantile with NaN involved, a non-deterministic result is returned.
You might need to run it a few times to see the different result

Wrapping the column into nullif(col, 'nan') seems to solve it

To Reproduce

Run it a few times

with a as (select 'NaN'::FLOAT as num union all select unnest(range(1,100)) as num union all select 'NaN'::FLOAT as num) 
select quantile_disc(num, [0.1, 0.9]) c1 from a;

OS:

Linux

DuckDB Version:

1.3.0

DuckDB Client:

Python

Hardware:

No response

Full Name:

Mauro Pagano

Affiliation:

Independent

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions