79148805

Date: 2024-11-01 16:47:31
Score: 1
Natty:
Report link

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;
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user2459396