summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/match_recognize/measures_aggr_factory.yql
blob: 7d74c6792f08b29df16f0dab4fd92ffb95826130 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
PRAGMA FeatureR010="prototype";

$input = SELECT * FROM AS_TABLE([
    <|time: 0, value: 1u, name: "A"|>,
]);

SELECT * FROM $input MATCH_RECOGNIZE (
    ORDER BY CAST(time AS Timestamp)
    MEASURES
        AGGREGATE_BY(A.value, AggregationFactory("sum")) AS aggr_factory_expr
    PATTERN (A)
    DEFINE
        A AS A.name = "A"
);