Implemented the mapPartitions summarization.