blob: 750db45647ef2d978385664f63b6faf62d71887e (
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
26
27
28
29
30
31
32
33
|
PRAGMA WindowNewPipeline;
$uint64_max = uint64('18446744073709551615');
$data = [
<|a: int8('-128'), count: 3|>,
<|a: int8('0'), count: 3|>,
<|a: int8('127'), count: 3|>,
];
$win_result = (
SELECT
COUNT(*) OVER w1 AS actual_count,
count,
FROM
AS_TABLE($data)
WINDOW
w1 AS (
ORDER BY
a ASC
RANGE BETWEEN $uint64_max PRECEDING AND $uint64_max FOLLOWING
)
);
$str = ($x) -> {
return CAST($x as String) ?? "null";
};
SELECT
Ensure(actual_count, count IS NOT DISTINCT FROM actual_count, $str(actual_count))
FROM
$win_result
;
|