questdb/questdb

Support negative numbers in `approx_percentile` function

Aperta

#4900 aperta il 28 ago 2024

 (9 commenti) (1 reazione) (0 assegnatari)Java (972 fork)batch import
EnhancementSQLhacktoberfest

Metriche repository

Star
 (13.403 stelle)
Metriche merge PR
 (Merge medio 5g 13h) (108 PR mergiate in 30 g)

Descrizione

Currently, approx_percentile only supports non-negative numbers. This limitation comes from the HdrHistogram library, which we use for approx_precentile. The library is designed for latency measurements, hence the limitation. HdrHistogram doesn't support negative numbers, so we'll need to modify the library.

Original text

To reproduce

CREATE TABLE archmag (a double, ts timestamp)timestamp(ts) PARTITION BY DAY WAL;
INSERT INTO archmag (a, ts) VALUES (-100.0,systimestamp()), (-20.0,systimestamp()), (-5.0,systimestamp());
select approx_percentile(a, 0.1) from archmag;

QuestDB version:

8.1.0

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

Amazon Linux 2023.4.20240528

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

ext4

Full Name:

Jacek Juraszek

Affiliation:

arencibia

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

  • Yes, I have

Additional context

error log: The value -100.0 is out of bounds for histogram, current covered range [6.668014432879854E240, 1.3656093558537942E244) cannot be extended any further. Caused by: [-1] The value -100.0 is out of bounds for histogram, current covered range [6.668014432879854E240, 1.3656093558537942E244) cannot be extended any further. Caused by:

Guida contributor