Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaravind/c70c80093f3e202ce3209bae284ae06f to your computer and use it in GitHub Desktop.
Save yaravind/c70c80093f3e202ce3209bae284ae06f to your computer and use it in GitHub Desktop.
val today = LocalDate.now
val todayTransactions = spark.read
.option("header", "true")
.option("inferSchema", "true")
.json(s"s3n://bucket-name/${today}/transaction.json")
val yesterdayTransactions = spark.read
.option("header", "true")
.option("inferSchema", "true")
.json(s"s3n://bucket-name/${today.minusDays(1)}/transaction.json")
val difference = todayTransactions.except(yesterdayTransactions)
difference.show(25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment