Ниже для BigQuery Standard SQL
#standardSQL
SELECT date, TIME_TRUNC(time, HOUR) hour, SUM(col1) AS Col1, SUM(col2) AS Col2
FROM `project.dataset.table`
GROUP BY date, hour
ORDER BY date, hour
Вы можете протестировать, поиграть с вышеупомянутыми, используя фиктивные данные в вашем вопросе:
#standardSQL
WITH `project.dataset.table` AS (
SELECT DATE "2018-10-26" date, TIME "19:05:00" time, 1 col1, 2 col2 UNION ALL
SELECT "2018-10-26", "19:15:00", 3, 4
)
SELECT date, TIME_TRUNC(time, HOUR) hour, SUM(col1) AS Col1, SUM(col2) AS Col2
FROM `project.dataset.table`
GROUP BY date, hour
ORDER BY date, hour
с результатом
Row date hour Col1 Col2
1 2018-10-26 19:00:00 4 6