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

/* custom error: RANGE frames over an ORDER BY expression of type "String" support only RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW mode */

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

SELECT
    COUNT(*) OVER w1 AS actual_count,
    count,
FROM
    AS_TABLE($data)
WINDOW
    w1 AS (
        ORDER BY
            a ASC
        RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
    )