Skip to content

[BUG] median value not correct #18867

@davidlghellin

Description

@davidlghellin

Describe the bug

The value median is not correct

To Reproduce

in datafusion-cli 51

SELECT median(n) FROM (SELECT 0 AS n UNION ALL SELECT 1  UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9);
Image

Expected behavior

same value of percentile 50
in datafusion-cli 51

SELECT percentile_cont(n,0.5) FROM (SELECT 0 AS n UNION ALL SELECT 1  UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9);
Image

Additional context

testing ibis tests in Sail and add agg funtion
related to lakehq/sail#1072

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions