Last active
July 2, 2020 12:15
-
-
Save crocker/bc924a3f2660d47a606be6d84ff17893 to your computer and use it in GitHub Desktop.
Find duplicates in a Spark DataFrame
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 transactions = spark.read | |
.option("header", "true") | |
.option("inferSchema", "true") | |
.json("s3n://bucket-name/transaction.json") | |
transactions.groupBy("id", "organization").count.sort($"count".desc).show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment