This (in perhaps a slightly different syntax flavor) works on Hive/Presto/SparkSQL as well by the way. Also in Apache drill.
https://drill.apache.org/docs/sql-window-functions-introduct...
https://drill.apache.org/docs/sql-window-functions-introduct...