Skip to content

Instantly share code, notes, and snippets.

@Welsige
Created September 15, 2020 00:22
Show Gist options
  • Select an option

  • Save Welsige/85e762dc1f978a0e41f73d03990611e3 to your computer and use it in GitHub Desktop.

Select an option

Save Welsige/85e762dc1f978a0e41f73d03990611e3 to your computer and use it in GitHub Desktop.
Scala Spark remove duplicates completely
val df02 = df01.withColumn("cnt", count("*").over(Window.partitionBy($"id"))).where($"cnt"===1).drop($"cnt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment