Skip to content

Better error message in approx_median() / approx_percentile() #6442

@puzpuzpuz

Description

@puzpuzpuz

To reproduce

create table x (d double);

insert into x values (0.0);
insert into x values (1000.0);
insert into x values (6.35e-11);
insert into x values (76179182.16484068);

select approx_median(d) from x;

The query fails with the following error:

The value 7.516817105484058E7 is out of bounds for histogram, current covered range [5.820766091346741E-11, 2048.0) cannot be extended any further.
Caused by: [-1] Cannot resize histogram covered range beyond (1L << 63) / (1L << 4) - 1.
Caused by: [-1] Operation would underflow and lose precision of already recorded value counts`, errno=-1, q=`select approx_median(d) from x

yet approx_median(d, 0) (notice lower precision from the default 1) succeeds. We should check if there is an easy way to support this dataset with the default precision or, at least, include a hint on lowering the precision into the error message.

QuestDB version:

9.2

OS, in case of Docker specify Docker and the Host OS:

Linux

File System, in case of Docker specify Host File System:

ext4

Full Name:

Andrei Pechkurov

Affiliation:

QuestDB

Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

  • Yes, I have

Additional context

No response

Metadata

Metadata

Assignees

Labels

FrictionSQLIssues or changes relating to SQL execution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions