Support sum/avg grouped queries