Skip to content

[Bug] Function PERCENTILE_APPROX return error result.  #5171

@HappenLee

Description

@HappenLee

Describe the bug
Column Data A: (65536, null, null,null)
Call function percentile_approx(A, 0.5) should return 65536, but result is nan

To Reproduce
Steps to reproduce the behavior:

  1. create table
CREATE TABLE `per` (
  `A` bigint(20) NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`A`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`A`) BUCKETS 5
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);
  1. Insert data into the table
insert into per values(65536)
  1. set parallel_fragment_exec_instance_num
set parallel_fragment_exec_instance_num = 15;
  1. Do query
SELECT PERCENTILE_APPROX(A, 0.5) from per;
+-----------------------------+
| percentile_approx(`A`, 0.5) |
+-----------------------------+
|                   65536                |
+-----------------------------+

There is a certain probability

result is

SELECT PERCENTILE_APPROX(A, 0.5) from per;
+-----------------------------+
| percentile_approx(`A`, 0.5) |
+-----------------------------+
|                   nan              |
+-----------------------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions