select
id,cnt,
sum(cnt) over w as sum_cnt
from
(
select 'a' as id, 1 as cnt
union all
select 'a' as id, 9 as cnt
union all
select 'a' as id, 4 as cnt
union all
select 'a' as id, 2 as cnt
) A
WINDOW w AS (PARTITION BY id order by cnt rows between unbounded preceding and unbounded following)
Settings allow_experimental_window_functions = 1