https://www.bigdataschool.ru/blog/function-aggregatebykey-in-spark.html
Как работает AggregateByKey() в Apache Spark: краткий ликбез и пара примеров