Last active
May 31, 2020 14:04
-
-
Save NeerajBhadani/b6cae0e12c1e6c14261f00718b8777ea to your computer and use it in GitHub Desktop.
lead
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") | |
val lead_df = | |
empsalary.withColumn("lead", lead("salary", 2).over(winSpec)) | |
lead_df.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
changed column name from lag to lead.