summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/window/win_range_wrong_bound_decimal.yql
blob: a8a8fbe2eea83d4e3af1060de15551317e7a2726 (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,2) */
/* custom error: Cannot add different decimals */

$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, 2) PRECEDING AND CURRENT ROW
        )
);

select * from $win_result;