Window with orderBy¶
It is tricky!!!
If you provide ORDER BY clause then the default frame is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW:
https://stackoverflow.com/questions/52273186/pyspark-spark-window-function-first-last-issue
Avoid using last and use first with
descending order by
instead. This gives less surprisings.Do NOT use order by if not necessary. It introduces unnecessary ...