Created
May 25, 2020 15:19
-
-
Save NeerajBhadani/3a45f591c94c6ec3d4d20ca4332e9bf8 to your computer and use it in GitHub Desktop.
Apply custom window Specification with custom Boundary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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