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
Presto has two versions of APPROX_PERCENTILE - one that produces a single percentile and another that produces an array of APPROX_PERCENTILE values. So when you see something like:
SELECT
APPROX_PERCENTILE(x, 0.1) AS percentile_10,
APPROX_PERCENTILE(x, 0.2) AS percentile_20,
APPROX_PERCENTILE(x, 0.3) AS percentile_30
FROM T
Rewrite it it:
SELECT
percentiles[1] AS percentile_10,
percentiles[2] AS percentile_20,
percentiles[3] AS percentile_30
FROM (
SELECT APPROX_PERCENTILE(x, ARRAY[0.1, 0.2, 0.3]) AS percentiles
FROM T
)
The text was updated successfully, but these errors were encountered:
Presto has two versions of APPROX_PERCENTILE - one that produces a single percentile and another that produces an array of APPROX_PERCENTILE values. So when you see something like:
SELECT
APPROX_PERCENTILE(x, 0.1) AS percentile_10,
APPROX_PERCENTILE(x, 0.2) AS percentile_20,
APPROX_PERCENTILE(x, 0.3) AS percentile_30
FROM T
Rewrite it it:
SELECT
percentiles[1] AS percentile_10,
percentiles[2] AS percentile_20,
percentiles[3] AS percentile_30
FROM (
SELECT APPROX_PERCENTILE(x, ARRAY[0.1, 0.2, 0.3]) AS percentiles
FROM T
)
The text was updated successfully, but these errors were encountered: