https://medium.com/plumbersofdatascience/windowing-functions-a-comprehensive-guide-to-sql-vs-spark-performance-fc1e304b789b