summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/window/win_range_string_current_row_fail.yql
blob: aa94698f66b311ac265e5c6609d2e1d96d9b1e31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
PRAGMA WindowNewPipeline;

/* custom error: Range frame for non numeric expressions is only allowed to be UNBOUNDED PRECEDING AND CURRENT ROW */

$data = [
    <|a: "apple", b: 1, count: 1|>,
    <|a: "banana", b: 1, count: 2|>,
];

SELECT
    COUNT(*) OVER w1 AS actual_count,
    count,
FROM
    AS_TABLE($data)
WINDOW
    w1 AS (
        PARTITION COMPACT BY
            b
        ORDER BY
            a ASC
        RANGE BETWEEN CURRENT ROW AND CURRENT ROW
    )