aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/histogram/test/cases/ToCumulativeDistributionFunction.sql
blob: e71db5c68f8da42a1369ffc7ff35859572e75b16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* syntax version 1 */
SELECT
    Histogram::ToCumulativeDistributionFunction(HISTOGRAM(key)) AS key_histogram,
    Histogram::ToCumulativeDistributionFunction(HISTOGRAM(subkey)) AS subkey_histogram,
    Histogram::ToCumulativeDistributionFunction(HISTOGRAM(value)) AS value_histogram,
    Histogram::Normalize(Histogram::ToCumulativeDistributionFunction(HISTOGRAM(subkey)), 100, True) AS subkey_norm_cdf_histogram
FROM (
    SELECT
        CAST(key AS Double) AS key,
        CAST(subkey AS Double) AS subkey,
        CAST(value AS Double) AS value
    FROM Input
);