https://medium.com/@ajaygupta.hbti/apache-spark-3-0-remarkable-improvements-in-custom-aggregation-41dbaf725903