Hi Andrey,
v2 looks good, I checked first_value, last_value and nth_value
against array_agg for every frame shape, and they all match now.
Maybe one more test
SELECT k, first_value(k) OVER w
FROM (VALUES (0), (1), (1), (1), (2)) t(k)
WINDOW w AS (ORDER BY k ROWS BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING
EXCLUDE TIES);
On Master it report ERROR: cannot fetch row before WindowObject's mark
position
This patch also covers 19731
Thanks,
Shihao