Found the answer, it is easy like this
WITH CAST(sumMap([period], [value]), 'Map(UInt32, Float64)') AS map
select bdate
, id
, period
, map[1] AS period_1
, map[2] AS period_2
, map[3] AS period_3
from test_8192590.some_table
group by bdate, id, period
order by bdate, id, period;