$sql = 'select * from Test_tGrossChart ' . $where . ' group by date_day_minute,date_day_hour,date_day,date_year, date_month order by date_year,date_month,date_day,date_day_hour,date_day_minute asc';
$rows = $databaseclickhouse->select($sql)->rows();
if ($rows) {
foreach ($rows as $row) {
// далее собираем все в массив
$time = strtotime($date_day_minute);
$data[] = array(
$time,
(int)$row['sumBytesOutIn'],
(int)$row['sumBytesIn'],
(int)$row['sumBytesOut'],
(int)$row['sumPacksOutIn'],
(int)$row['sumPacksIn'],
(int)$row['sumPacksOut'],
(int)$row['sumSessionsInOut'],
(int)$row['sumSessionsIn'],
(int)$row['sumSessionsOut']
);
}