Debug calculate group_by