You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
quantile_at_value returning incorrect value for tdigest, however qdigest returning correct value
50% of value is 1. Tdigest returns quantile 0.75 for 1, and qdigest returns correct 0.5 value
WITH test AS (
SELECT
*
FROM (
VALUES
(0.1),(0.2),(0.2),(0.3),(0.4),(0.5),(0.5),(0.5),(0.6),(0.6),
(1.0),(1.0),(1.0),(1.0),(1.0),(1.0),(1.0),(1.0),(1.0),(1.0)
) AS t(val)
)
SELECT
QUANTILE_AT_VALUE(
CAST(CAST(TDIGEST_AGG(val) AS VARBINARY) AS TDIGEST(DOUBLE)),
1.0
) AS p100,
QUANTILE_AT_VALUE(
CAST(CAST(TDIGEST_AGG(val) AS VARBINARY) AS TDIGEST(DOUBLE)),
0.9999
) AS p9999,
QUANTILE_AT_VALUE(
CAST(CAST(qdigest_agg(val) AS VARBINARY) AS QDIGEST(DOUBLE)),
1.0
) AS q_digest
FROM test
The text was updated successfully, but these errors were encountered:
quantile_at_value returning incorrect value for tdigest, however qdigest returning correct value
50% of value is 1. Tdigest returns quantile 0.75 for 1, and qdigest returns correct 0.5 value
The text was updated successfully, but these errors were encountered: