aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/histogram/test/cases/Methods.sql
blob: 8c351f80708487421de8b4eb2e065bdc4cd9fb0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
/* syntax version 1 */
SELECT
    Histogram::GetSumAboveBound(histo, 5.0) AS GetSumAboveBound,
    Histogram::GetSumBelowBound(histo, 5.0) AS GetSumBelowBound,
    Histogram::CalcUpperBound(histo, 5.0) AS CalcUpperBound,
    Histogram::CalcLowerBound(histo, 5.0) AS CalcLowerBound,
    Histogram::GetSumInRange(histo, 5.0, 20.0) AS GetSumInRange
FROM (
    SELECT
        HISTOGRAM(CAST(key AS Double)) AS histo
    FROM Input
);