Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NeerajBhadani/3a45f591c94c6ec3d4d20ca4332e9bf8 to your computer and use it in GitHub Desktop.
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