https://spark-school.ru/blog/performance-boosting-with-bucketing/
Зачем вам бакетирование в Apache Spark