Group by array columns