Created
May 25, 2020 15:13
-
-
Save NeerajBhadani/7a10e5082225f7d0f47109c564eb368c to your computer and use it in GitHub Desktop.
lag
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 lag_df = | |
empsalary.withColumn("lag", lag("salary", 2).over(winSpec)) | |
lag_df.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment