Use Aggregator for Spark SQL