Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save NeerajBhadani/3a45f591c94c6ec3d4d20ca4332e9bf8 to your computer and use it in GitHub Desktop.
Apply custom window Specification with custom Boundary
val winSpec = Window.partitionBy("depName").orderBy("salary")
.rangeBetween(300L, Window.unboundedFollowing)
val range_unbounded_df = empsalary.withColumn("max_salary", max("salary").over(winSpec))
range_unbounded_df.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment