Fixed aggregate query in AdHocQueries.scala