Ниже для BigQuery Standard SQL
#standardSQL
SELECT email, action,
SUM(time_of_day_repetition) total_individual_action_count,
ARRAY_AGG(
STRUCT(time_of_day AS time_of_day_with_max_repetition, time_of_day_repetition AS max_repetition)
ORDER BY time_of_day_repetition DESC LIMIT 1
)[OFFSET(0)].*
FROM (
SELECT email, action, time_of_day,
COUNT(1) time_of_day_repetition
FROM `project.dataset.table`
GROUP BY email, action, time_of_day
)
GROUP BY email, action