Added support for grouping operations for Scala.