There is currently no QUALIFY in Spark SQL, but we really need it. As mentioned in a comment above, there is a JIRA for it, but it does not seem to be getting any traction of late: https://issues.apache.org/jira/browse/SPARK-31561