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

/* custom error: Error while processing RANGE bound for column type: Decimal(3,1) and offset type: Decimal(3,1) */
/* custom error: Expected positive literal value */

$data = [
    <|a: Decimal('-8', 3, 1), b: 1|>,
];

$win_result = (
    SELECT
        SUM(a) OVER w1 AS actual_sum1,
    FROM
        AS_TABLE($data)
    WINDOW
        w1 AS (
            PARTITION COMPACT BY
                b
            ORDER BY
                a ASC
            RANGE BETWEEN Decimal('-8', 3, 1) PRECEDING AND CURRENT ROW
        )
);

select * from $win_result;