Allow group by (and even check in Scala)